Bug 24911 - Exception holidays treated as unique holidays in calendar
Summary: Exception holidays treated as unique holidays in calendar
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Holidays (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-20 10:08 UTC by Emmi Takkinen
Modified: 2020-10-02 13:27 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmi Takkinen 2020-03-20 10:08:30 UTC
When exception holiday is made it's still treated as unique holiday. Only days that aren't holidays but are included in the range of "Generate exceptions on a range of dates" are exceptions. To test:

1. Create holidays on a range e.g 23-24/3
2. Create exceptions on a range of 24-25/3
3. When editing: 
=> 24/3 has label "Unique holiday" and is listed both in "Unique holidays" and "Exception holidays" lists
=> 25/3 has label "Holiday exception" and is listed only in "Exception holidays"

Problems this is causing:

1. If you edit title and description of 24th day, you'll notice from holiday lists that edit only applies to unique holiday. In "Exception holidays" title and description remain the same.  
2. When trying to delete 24th, only option "Delete this holiday" is given, not "Delete this exception" as it should. And if you use "Delete this holiday", unique holiday "beneath" exception gets deleted but day remains as exception holiday. Of course "Delete exceptions on range" still works and single exceptions can be deleted with it.
Comment 1 Emmi Takkinen 2020-03-20 11:36:43 UTC
Just to make clear, this only happens if exception is made for unique holidays. Exceptions for holidays repeating weekly and yearly work properly. And now when I looked closer, hint for option "Generate exceptions on a range of dates" says "You can make an exception on a range of dates repeated yearly." and there isn't option to make single exception for unique holidays like there is with repeatable holidays. So... there shouldn't even be option to add exceptions for unique holidays? How should this be handled, make exceptions work properly with unique holidays or hide option "Generate exceptions on a range of dates" if holiday is unique?
Comment 2 Emmi Takkinen 2020-03-20 12:39:42 UTC
Ok, did some digging and I might have answered to my question myself. Patch with an option to generate exceptions on range for unique holidays was introduced in bug 7351. So it is where it should be, text in the hint just confused me. Sorry about this monologue.
Comment 3 Katrin Fischer 2020-05-23 11:04:22 UTC
Hm, I think there is no point to have an exception for a unique holiday = you could just delete it. So maybe we should not allow exceptions in that case and suggest to remove from the calendar instead?
Comment 4 Emmi Takkinen 2020-06-08 05:50:53 UTC
(In reply to Katrin Fischer from comment #3)
> Hm, I think there is no point to have an exception for a unique holiday =
> you could just delete it. So maybe we should not allow exceptions in that
> case and suggest to remove from the calendar instead?

I agree. So we could just hide the option to generate exception when selected holiday is unique. Also seems like this was already reported in bug 9918.
Comment 5 Emmi Takkinen 2020-10-02 13:27:46 UTC
(In reply to Emmi Takkinen from comment #4)
> (In reply to Katrin Fischer from comment #3)
> > Hm, I think there is no point to have an exception for a unique holiday =
> > you could just delete it. So maybe we should not allow exceptions in that
> > case and suggest to remove from the calendar instead?
> 
> I agree. So we could just hide the option to generate exception when
> selected holiday is unique. Also seems like this was already reported in bug
> 9918.

Wrong bug, meant bug 9118. It's somewhat same as this one, maybe some cleanup is in order for all options...