From 57998d2d442ab7a327c0c2fe2c327ebe78963f14 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 9 Jun 2022 14:26:33 +0000 Subject: [PATCH] Bug 18064: (follow-up) Get libraries as a list Output: One line per library as expected, along with the date + 366 days for libraries without set holidays, and start dates postponed by 366 days + the amount of days corresponding to library holidays. Added random holidays to 3 different libraries, of different variety, (Holiday Repeating Yearly, Unique Holiday, etc.) and ran longoverdue.pl, getting the same start days, then ran with patch applied and returned above result as expected. Test plan : 1) For clearer vision on what the patch does, have at least "2" libraries 2) Go to Tools/Calendar and place holidays, on each of the libraries for example, of any kind (special, repeated, as you want) 3) Manually run the misc/cronjobs/longoverdue.pl script with the -v (verbose) argument to get as much information as possible 4) You will see a common "block", with today's date + 366 days (by default if you don't pass any arguments to the script), holidays are not taken into account in this date range 5) Apply my patch 6) Launch the updatedatabase 7) Set the new system preference "LongOverdueNoticeCalendar" to "use calendar" 8) Repeat step 3 9) You will see in output one line per library and according to the number of days off in the interval of dates, the start date of the analysis will have been postponed by as many days in order to take these holidays into account. Signed-off-by: Michal Urban --- misc/cronjobs/longoverdue.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index b4cd403a16..68aceb50ea 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -325,7 +325,7 @@ sub get_number_of_holidays { $start_date = dt_from_string($start_date); $end_date = dt_from_string($end_date); - my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } ); + my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } )->as_list; my $calendar; foreach my $branch ( @branches ) { -- 2.25.1