[Koha-bugs] [Bug 25533] Perl "not numeric" warning on the "Holds" page
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri Jun 19 11:10:49 CEST 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25533
Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |m.de.rooy at rijksmuseum.nl
Status|Signed Off |Failed QA
--- Comment #3 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Thanks for your patch !
You remove the warning, but are you interpreting the value correctly?
- my $holds_per_record = $rule ? $rule->{holds_per_record} : 0;
+ my $holds_per_record = $rule ? $rule->{holds_per_record} || 0 : 0;
$max = $holds_per_record if $holds_per_record > $max;
If space or empty string means Unlimited and we replace it by 0, would our
compares be correct ?
Note that perl now does the same thing but removing the warn will only hide the
problem you found in this code !
I see that code is calculating the number of remaining holds:
my $remaining_holds_for_record = $max_holds_for_record - $holds->count();
If max is 0 but should mean Unlimited, this definitely goes wrong ?
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list