From f55cbb1c01067d8d35edaa46301026b619ac2006 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 Nov 2024 09:37:02 +0100 Subject: [PATCH] Bug 38357: Prevent holidays to be wrongly added This patch resets @holiday_list to an empty array, to prevent holidays to be accumulated in worker's memory. If you added single holidays to library A then others to library B, holidays from A were also added to B. Test plan: Go to /cgi-bin/koha/tools/holidays.pl Define the holidays for Centerville Select a date To: another date (pick only 2 days to ease testing) Set a title "cpl" Tick "Holidays on a range" Save Define the holidays for Fairview Select *another* date To: another date (pick only 2 days to ease testing) Set a title "fpl" Tick "Holidays on a range" Save => Without this patch Fairview has 4 days of holidays instead of 2 => With this patch applied the dates you selected are considered holidays for Fairview Signed-off-by: Emmi Takkinen Signed-off-by: Emily Lamancusa Signed-off-by: Katrin Fischer (cherry picked from commit 43e22821a99bc9fee50354039f1215f8ff662b5a) Signed-off-by: Lucas Gass (cherry picked from commit 5f5a0b225fa06313047f4c7d7fde4f1f9d904411) Signed-off-by: Fridolin Somers --- tools/newHolidays.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/newHolidays.pl b/tools/newHolidays.pl index b07079d52b..9eb49fb2bf 100755 --- a/tools/newHolidays.pl +++ b/tools/newHolidays.pl @@ -60,7 +60,7 @@ if ($description) { } # We make an array with holiday's days -our @holiday_list; +our @holiday_list = (); if ($end_dt){ for (my $dt = $first_dt->clone(); $dt <= $end_dt;