Bug 18455

Summary: Holiday range has incorrect starting date when crossing a weekly holiday
Product: Koha Reporter: Mark Alexander <marka>
Component: HolidaysAssignee: Bugs List <koha-bugs>
Status: CLOSED WORKSFORME QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: katrin.fischer, marka
Version: 16.11   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Screen shot of calendar after creation of two holidays mentioned in description.

Description Mark Alexander 2017-04-19 11:00:58 UTC
Created attachment 62359 [details]
Screen shot of calendar after creation of two holidays mentioned in description.

When a holiday of type "Holidays on a range" is created with a date range that overlaps a holiday of type "Holiday repeated every same day of the week", the starting date of the range is changed to a month or two earlier, creating a large number of incorrect holidays.

To reproduce:

Start with an empty calendar.

Create a holiday on a Wednesday and give it type "Holiday repeated every same day of the week".

Create a holiday on a Tuesday (e.g., May 2 2017) with an ending date of a Thursday (e.g., May 4 2017) and a type of "Holidays on a range".  This will create a set of single holidays starting on a day much earlier than the user-specified start date.  On my system (16.11.06.000) it created holidays starting on March 30 2017.

See attached screenshot for the result.
Comment 1 Katrin Fischer 2017-05-14 21:53:56 UTC
We have run into this repeatedly in a current project, but it was hard to come up with a test plan that would make this reproducable. Thx, Mark!

I am upping severity a bit, as this has actually led to circulation dying in one of the libraries that ran into this. Repeatable holidays holidays for every day of the year.
Comment 2 Katrin Fischer 2017-08-17 13:48:15 UTC
Hi Mark,

I've repeated your test plan with every available dateformat setting on master, but I am unable to reproduce the problem. 

Does it still happen for you?
Comment 3 Mark Alexander 2017-08-18 14:49:43 UTC
We have upgraded to 17.05.01, and the problem doesn't seem to happen any more.
Comment 4 Katrin Fischer 2017-08-18 15:21:16 UTC
Thx for the feedback Mark - I will close WORKSFORME. We can reopen if it manifests again.