Summary: | Silence warn related to number_of_copies | ||
---|---|---|---|
Product: | Koha | Reporter: | Magnus Enger <magnus> |
Component: | Cataloging | Assignee: | Magnus Enger <magnus> |
Status: | Pushed to oldstable --- | QA Contact: | Testopia <testopia> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | fridolin.somers, jonathan.druart, lucas, m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
24.05.00,23.11.01,23.05.07
|
|
Circulation function: | |||
Attachments: |
Bug 35414: Silence warn related to number_of_copies
Bug 35414: Silence warn related to number_of_copies Bug 35414: Silence warn related to number_of_copies |
Description
Magnus Enger
2023-11-28 12:58:26 UTC
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? Created attachment 159338 [details] [review] 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! Created attachment 159365 [details] [review] 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> Created attachment 159425 [details] [review] 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> Pushed for 24.05! Well done everyone, thank you! Pushed to 23.11.x for 23.11.01 Backported to 23.05.x for upcoming 23.05.07 |