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 <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-11-06 09:37:02 +01:00 committed by Katrin Fischer
parent be6e13b50c
commit 43e22821a9
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -61,7 +61,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;