After migrating 37 instances from v19.11 to v20.11.13 the /etc/cron.daily/koha-common logs the following on 7 instances: "Use of uninitialized value in string eq at /usr/share/koha/lib/C4/Overdues.pm line 663." We've checked the settings across the instances and the database. We can't find the root of this warning/error.
Ah indeed code looks weak : https://git.koha-community.org/Koha-community/Koha/src/branch/20.11.x/C4/Overdues.pm#L663 It fetches first row but they may be no rows. Code is from Bug 9180
(In reply to Elias from comment #0) > After migrating 37 instances from v19.11 to v20.11.13 the > /etc/cron.daily/koha-common logs the following on 7 instances: > > "Use of uninitialized value in string eq at > /usr/share/koha/lib/C4/Overdues.pm line 663." > > We've checked the settings across the instances and the database. > We can't find the root of this warning/error. Do you mean to say that in the other 30 instances the error doesn't occur and the overdues are processed correctly?
We implemented a solution, replacing line 663 in /usr/share/koha/lib/C4/Overdues.pm, which originally reads: if ( $branchcodes->[0] eq '' ) { by: if ( !defined ($branchcodes->[0]) || $branchcodes->[0] eq '' ) { Hope this is useful.
My colleague just sent me this update to (In reply to Anke from comment #3) > We implemented a solution, replacing line 663 in > /usr/share/koha/lib/C4/Overdues.pm, which originally reads: > > if ( $branchcodes->[0] eq '' ) { > > by: > > if ( !defined ($branchcodes->[0]) || $branchcodes->[0] eq '' ) { > > Hope this is useful. I just received this enhancement: if ( @$branchcodes >= 1 && ( !defined ($branchcodes->[0]) || $branchcodes->[0] eq '' ) ) { This prevents the routine from returning libraries if there are no overdue rules.
Pb still exists in actual master 21.12
This bug is present also in 22.05, where the line in question is 675 instead of 663. Could this be fixed for future versions, so we won't have to change Overdues.pm manually after every update?