From 319f954c2194c9f6c090a9def9f6b04eaeb81035 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. Test plan: 1. Go to Tools - Overdue notice/status triggers and verify that for every single patron type for both Default and every individual library, you have no value set for Delay, so that you will never send anyone an overdue notice 2. Run the cron job which creates and sends overdue notices 3. Confirm the above mentioned error no longer appears Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer (cherry picked from commit 4c8586270af07d4281215d060cef004e33999972) Signed-off-by: Lucas Gass --- 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.39.5