Bugzilla – Attachment 136214 Details for
Bug 18064
Long overdue cronjob does not follow the library's calendar and skip closed days
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18064: (follow-up) Get libraries as a list
Bug-18064-follow-up-Get-libraries-as-a-list.patch (text/plain), 2.22 KB, created by
Michal Urban
on 2022-06-16 22:24:21 UTC
(
hide
)
Description:
Bug 18064: (follow-up) Get libraries as a list
Filename:
MIME Type:
Creator:
Michal Urban
Created:
2022-06-16 22:24:21 UTC
Size:
2.22 KB
patch
obsolete
>From 57998d2d442ab7a327c0c2fe2c327ebe78963f14 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >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 <michalurban177@gmail.com> >--- > 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18064
:
130363
|
135888
|
136213
|
136214
|
136263
|
139978
|
145920
|
147496
|
147497
|
159088