[Koha-bugs] [Bug 25850] CalcDateDue freezes with 'useDaysMode' set to 'Dayweek' and the due date lands on a sunday.
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Jun 29 10:24:07 CEST 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25850
Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #106207|0 |1
is obsolete| |
--- Comment #11 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 106383
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106383&action=edit
Bug 25850: Adapt day of week in Koha::Calendar::get_push_amt to 0..6 with 0
being Sunday.
1. Go to tools -> calendar and make sure Sundays are holidays by adding
a holiday on a Sunday and selecting "Holiday repeated every same day
of the week" and "Copy to all libraries" and save.
2. Go to administration -> system preferences and select "Use the
calendar to push the due date to the next open matching weekday
for weekly loan periods, or the next open day otherwise" for the
system preference "useDaysMode" and save the system preferences.
3. Put the below code in a file name test.pl and execute it using
the command "sudo koha-shell -c 'perl test.pl' kohadev"
use Koha::Calendar;
my $calendar = Koha::Calendar->new( branchcode => 'CPL' );
$dt = DateTime->new(
year => 2020,
month => 06,
day => 21
);
print "This is a sunday: " .
$dt->day_of_week . "\n";
my $ndt = $calendar->next_open_days($dt, 0);
print "This is a monday: " .
$ndt->day_of_week . "\n";
4. Without the patch applied, this script
will freeze after printing "This is a
sunday ...". Abort using ctrl-c.
5. Apply patch and run the script again.
The test script will now complete.
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
More information about the Koha-bugs
mailing list