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>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Magnus Enger 2023-11-29 14:58:08 +01:00 committed by Katrin Fischer
parent 4c6517767a
commit 8ba9ea8a87
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -238,7 +238,7 @@ if ($op eq "additem") {
my $add_duplicate_submit = $input->param('add_duplicate_submit');
my $add_multiple_copies_submit = $input->param('add_multiple_copies_submit');
my $save_as_template_submit = $input->param('save_as_template_submit');
my $number_of_copies = min( scalar $input->param('number_of_copies'), 1000 ); # TODO refine hardcoded maximum?
my $number_of_copies = min( scalar $input->param('number_of_copies') || 0, 1000 ); # TODO refine hardcoded maximum?
my @columns = Koha::Items->columns;
my $item = Koha::Item->new;