[Bug 27011] New: Warnings in returns.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Bug ID: 27011 Summary: Warnings in returns.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: joonas.kylmala@helsinki.fi QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When you check-in some books you get the following warnings to error logs:
[WARN] Use of uninitialized value in concatenation (.) or string at /usr/share/koha/intranet/cgi-bin/circ/returns.pl line 164. [WARN] Use of uninitialized value in concatenation (.) or string at /usr/share/koha/intranet/cgi-bin/circ/returns.pl line 402.
This seems to be due to treating the patron fields as non-null values:
164 my $name = $patron ? $patron->surname . ", " . $patron->title . " " . $patron->firstname : '';
The DB schema allows NULL values (and I think that is okay) so we should check for every one of these whether the value is defined or not before using it. -- 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=27011 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Blocks| |27126 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27126 [Bug 27126] [OMNIBUS] Warnings from logs must be removed -- 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=27011 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25790 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25790 [Bug 25790] [OMNIBUS] warnings removal -- 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=27011 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|27126 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27126 [Bug 27126] [OMNIBUS] Warnings from logs must be removed -- 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=27011 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18789 Keywords| |Academy --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- The variable is no longer used in the template, it has been removed by: commit 76eb3a0549efe4c1f1557071a6cb4b33d4bd3e4d Bug 18789: (follow-up) Pass a Koha::Patron object from returns.pl - <td>[% name %]</td> + <td>[% INCLUDE 'patron-title.inc' patron=patron %]</td> We can simply remove the $name variable from the controller script. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18789 [Bug 18789] Send a Koha::Patron object to the templates -- 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=27011 Amy King <amyking386@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amyking386@gmail.com Assignee|koha-bugs@lists.koha-commun |amyking386@gmail.com |ity.org | -- 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=27011 Amy King <amyking386@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 --- Comment #2 from Amy King <amyking386@gmail.com> --- Created attachment 115291 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115291&action=edit Bug 27011 removed $name variable Test Plan 1. Check out a book 2. Check in a book 3. Note what happens 4. Apply patch 5. Repeat step 1-2 6. Note that it doesn't break and everything still works -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115291|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115301 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115301&action=edit Bug 27011: Remove unused $name variable The variable is no longer used in the template, it has been removed by: commit 76eb3a0549efe4c1f1557071a6cb4b33d4bd3e4d Bug 18789: (follow-up) Pass a Koha::Patron object from returns.pl - <td>[% name %]</td> + <td>[% INCLUDE 'patron-title.inc' patron=patron %]</td> We can simply remove the $name variable from the controller script. Test Plan: 1. Check out a book 2. Check in a book 3. Note what happens 4. Apply patch 5. Repeat step 1-2 6. Note that it doesn't break and everything still works JD Amended patch: fix commit message -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #4 from David Nind <david@davidnind.com> --- I may be testing the wrong way, but I don't see the errors in any of the logs when checking out and checking in a book (using koha-testing-docker). Everything works as expected without or with the patch applied. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 --- Comment #5 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- (In reply to David Nind from comment #4)
I may be testing the wrong way, but I don't see the errors in any of the logs when checking out and checking in a book (using koha-testing-docker).
Everything works as expected without or with the patch applied.
Based on the code I think the warning only triggers when there is reserve attached to the item. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Andrew Fuerste-Henry <andrew@bywatersolutions.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=27011 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115301|0 |1 is obsolete| | --- Comment #6 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 115319 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115319&action=edit Bug 27011: Remove unused $name variable The variable is no longer used in the template, it has been removed by: commit 76eb3a0549efe4c1f1557071a6cb4b33d4bd3e4d Bug 18789: (follow-up) Pass a Koha::Patron object from returns.pl - <td>[% name %]</td> + <td>[% INCLUDE 'patron-title.inc' patron=patron %]</td> We can simply remove the $name variable from the controller script. Test Plan: 1. Check out a book 2. Check in a book 3. Note what happens 4. Apply patch 5. Repeat step 1-2 6. Note that it doesn't break and everything still works JD Amended patch: fix commit message Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Slightly updated test plan: 1 - have a patron without a title 2 - place a hold on an item for that patron 3 - check item in 4 - see message in error log 5 - apply patch, restart services 6 - repeat 1-3, no error generated -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 --- Comment #8 from David Nind <david@davidnind.com> --- (In reply to Joonas Kylmälä from comment #5)
Based on the code I think the warning only triggers when there is reserve attached to the item.
Thanks Joonas for clarifying! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115319|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 115523 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115523&action=edit Bug 27011: Remove unused $name variable The variable is no longer used in the template, it has been removed by: commit 76eb3a0549efe4c1f1557071a6cb4b33d4bd3e4d Bug 18789: (follow-up) Pass a Koha::Patron object from returns.pl - <td>[% name %]</td> + <td>[% INCLUDE 'patron-title.inc' patron=patron %]</td> We can simply remove the $name variable from the controller script. Test Plan: 1. Check out a book 2. Check in a book 3. Note what happens 4. Apply patch 5. Repeat step 1-2 6. Note that it doesn't break and everything still works JD Amended patch: fix commit message Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Excellent work, Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.05.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=27011 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, 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=27011 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patch removes a release notes| |variable ($name) that is no | |longer used in Circulation | |> Check in | |(/cgi-bin/koha/circ/returns | |.pl), and the resulting | |warnings (..[WARN] Use of | |uninitialized value in | |concatenation (.) or string | |at..) that were recorded in | |the error log. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00 |21.05.00,20.11.03 released in| | CC| |fridolin.somers@biblibre.co | |m Status|Pushed to master |Pushed to stable --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00,20.11.03 |21.05.00,20.11.03,20.05.09 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #13 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Pushed to oldoldstable CC| |victor@tuxayo.net Version(s)|21.05.00,20.11.03,20.05.09 |21.05.00,20.11.03,20.05.09, released in| |19.11.15 --- Comment #14 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Backported: Pushed to 19.11.x branch for 19.11.15 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|25790 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25790 [Bug 25790] [OMNIBUS] warnings removal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27011 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25790 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25790 [Bug 25790] [OMNIBUS] warnings removal -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org