From 8c5ff8f64897edb544e81623111b225b76b34356 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sun, 23 Jun 2024 14:13:35 +0200 Subject: [PATCH] Bug 36128: Use of uninitialized value in string eq at /usr/share/koha/lib/C4/Overdues.pm Fixes the following error message when running the overdues check cronjob on a Koha system without defined overdue rules: /etc/cron.daily/koha-common: Use of uninitialized value in string eq at /usr/share/koha/lib/C4/Overdues.pm line 686. by checking if the variable is defined before comparing it. --- C4/Overdues.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 41674a468a..a2494f7f1e 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -683,7 +683,7 @@ sub GetBranchcodesWithOverdueRules { WHERE delay1 IS NOT NULL ORDER BY branchcode |); - if ( $branchcodes->[0] eq '' ) { + if ( defined $branchcodes->[0] && $branchcodes->[0] eq '' ) { # If a default rule exists, all branches should be returned return Koha::Libraries->search({}, { order_by => 'branchname' })->get_column('branchcode'); } -- 2.45.2