[Bug 26137] New: Warn on malformed param on log viewer (viewlog.pl)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Bug ID: 26137 Summary: Warn on malformed param on log viewer (viewlog.pl) Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Staff Client Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com In bug 25893 I noticed a warn when loading log viewer. After some investigation I believe it comes from: 94 subscriptionsnumber => CountSubscriptionFromBiblionumber(scalar $input->param('object')), This may not return a value, if we don't have an object - when it doesn't we get a warn -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 107804 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=107804&action=edit Bug 26137: Prevent warns form malformed params To test: 1 - Tail plack logs 2 - Browse to Tools->Log viewer 3 - Note an error 4 - Apply patch 5 - Confirm error is gone 6 - Confirm everytihg stil works right -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=25893 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #2 from Fridolin SOMERS <fridolin.somers@biblibre.com> ---
my $subscriptionsnumber = CountSubscriptionFromBiblionumber(scalar $input->param('object')); Why not CountSubscriptionFromBiblionumber($object) ?
And if object is empty maybe not call this method. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #3 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Needs a rebase since Bug 25893 is integrated -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #107804|0 |1 is obsolete| | --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 110936 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110936&action=edit Bug 26137: Prevent warns form malformed params To test: 1 - Tail plack logs 2 - Browse to Tools->Log viewer 3 - Note an error 4 - Apply patch 5 - Confirm error is gone 6 - Confirm everytihg stil works right -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110936|0 |1 is obsolete| | --- Comment #5 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 110981 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110981&action=edit Bug 26137: Prevent warns form malformed params To test: 1 - Tail plack logs 2 - Browse to Tools->Log viewer 3 - Note an error 4 - Apply patch 5 - Confirm error is gone 6 - Confirm everytihg stil works right Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 --- Comment #6 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Ok does the job. I understand its for the number in left tab of biblio pages : Subscriptions (2) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 --- Comment #7 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- I think we should after this bug review the template koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc : [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&biblionumber=[% biblio_object_id | url %]">Subscriptions ([% subscriptionsnumber | html %])</a></li>[% END %] I propose we create a new method in Koha/Template/Plugin/Biblio.pm : SubscriptionsCount, like HoldsCount -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110981|0 |1 is obsolete| | --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 111073 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111073&action=edit Bug 26137: Prevent warns form malformed params To test: 1 - Tail plack logs 2 - Browse to Tools->Log viewer 3 - Note an error 4 - Apply patch 5 - Confirm error is gone 6 - Confirm everytihg stil works right Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Fridolin SOMERS from comment #7)
I think we should after this bug review the template koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc : [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&biblionumber=[% biblio_object_id | url %]">Subscriptions ([% subscriptionsnumber | html %])</a></li>[% END %]
I propose we create a new method in Koha/Template/Plugin/Biblio.pm : SubscriptionsCount, like HoldsCount
No, please don't create TT plugin method for that. The Koha::Biblio object's methods must be called instead. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- The test is weird, I would have expected to call CountSubscriptionFromBiblionumber only if the "object" param is passed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 111367 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111367&action=edit [ALTERNATIVE PATCH] Bug 26137: Remove warnings from viewlog.pl The warnings are Use of uninitialized value $val in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 138. Problem = a value of has been passed to param without key at /kohadevbox/koha/C4/Templates.pm line 138. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Julian, Nick, Frido, what about this alternative patch? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #111073|0 |1 is obsolete| | Attachment #111367|0 |1 is obsolete| | --- Comment #13 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 111390 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111390&action=edit Bug 26137: Remove warnings from viewlog.pl The warnings are Use of uninitialized value $val in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 138. Problem = a value of has been passed to param without key at /kohadevbox/koha/C4/Templates.pm line 138. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #12)
Julian, Nick, Frido, what about this alternative patch?
That works and is simple, good for me -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|20.11.00 |20.11.00, 20.05.06 released in| | CC| |lucas@bywatersolutions.com --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz --- Comment #17 from Aleisha Amohia <aleisha@catalyst.net.nz> --- enhancement, not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26137 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to stable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org