[Bug 35414] New: Silence warn related to number_of_copies
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35414 Bug ID: 35414 Summary: Silence warn related to number_of_copies Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl cataloguing/additem.pl has this code: my $number_of_copies = min( scalar $input->param('number_of_copies'), 1000 ); # TODO refine hardcoded maximum? "number_of_copies" comes from the "Add multiple copies of this item" feature. The field for entering the number of copies defaults to empty, and this results in this warning, from the code above: [WARN] Argument "" isn't numeric in subroutine entry at /usr/share/koha/intranet/cgi-bin/cataloguing/additem.pl line 233. We could fix this a couple of ways: - Make the number_of_copies field default to 1 - Fix the code, so 1 is used for number_of_copies, if the input is empty -- 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=35414 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I would do this: - my $number_of_copies = min( scalar $input->param('number_of_copies'), 1000 ); # TODO refine hardcoded maximum? + my $number_of_copies = min( $input->param('number_of_copies') || 0, 1000 ); # TODO refine hardcoded maximum? -- 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=35414 Magnus Enger <magnus@libriotech.no> 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=35414 --- Comment #2 from Magnus Enger <magnus@libriotech.no> --- Created attachment 159338 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159338&action=edit Bug 35414: Silence warn related to number_of_copies To test in ktd: - Tail the logs with "sudo tail -f /var/log/koha/kohadev/plack*.log" - Find a record in the staff client - Add an item to the record - Observe "[WARN] Argument "" isn't numeric in subroutine entry ..." in /var/log/koha/kohadev/plack-intranet-error.log - Apply this patch - restart_all - Tail the logs again - Add another item - Observe the absence of the earlier warning Thanks to Jonathan Druart for suggesting this particular solution! -- 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=35414 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |magnus@libriotech.no |ity.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=35414 Owen Leonard <oleonard@myacpl.org> 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=35414 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159338|0 |1 is obsolete| | --- Comment #3 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 159365 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159365&action=edit Bug 35414: Silence warn related to number_of_copies To test in ktd: - Tail the logs with "sudo tail -f /var/log/koha/kohadev/plack*.log" - Find a record in the staff client - Add an item to the record - Observe "[WARN] Argument "" isn't numeric in subroutine entry ..." in /var/log/koha/kohadev/plack-intranet-error.log - Apply this patch - restart_all - Tail the logs again - Add another item - Observe the absence of the earlier warning Thanks to Jonathan Druart for suggesting this particular solution! Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35414 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=35414 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159365|0 |1 is obsolete| | --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 159425 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159425&action=edit Bug 35414: Silence warn related to number_of_copies To test in ktd: - Tail the logs with "sudo tail -f /var/log/koha/kohadev/plack*.log" - Find a record in the staff client - Add an item to the record - Observe "[WARN] Argument "" isn't numeric in subroutine entry ..." in /var/log/koha/kohadev/plack-intranet-error.log - Apply this patch - restart_all - Tail the logs again - Add another item - Observe the absence of the earlier warning Thanks to Jonathan Druart for suggesting this particular solution! Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35414 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |24.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=35414 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35414 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|24.05.00 |24.05.00,23.11.01 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35414 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.05.00,23.11.01 |24.05.00,23.11.01,23.05.07 released in| | CC| |lucas@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable --- Comment #7 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 23.05.x for upcoming 23.05.07 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org