When updating exception holidays they are cleared from the cache until Koha::Calendar->exception_holidays is called That routine checks the cache, and then generates the holidays for a single branch and sets them in the cache. This is incorrect. single_holidays handles the situation correctly and exception_holidays should do the same.
Created attachment 106968 [details] [review] Bug 26000: Unit test
Created attachment 106969 [details] [review] Bug 26000: Cache all branches for exception_holidays To test: 0 - Have an itemtype rule shared for branch A and B, or same period 1 - Set some holidays for branch A within circ period for an itemtype 2 - Set same holidays, but make some an exception, for branch b 3 - Set useDaysMode to 'Use the calendar to skip days the library is closed' 4 - Checkout an item for branch A, date is pushed forward 5 - Checkout an item for branch B, date is pushed forward? It hsould not be the same as A because fo holiday exception 6 - Apply patch 7 - Restart all 8 - Checkout an item for branch A, date is pushed forward 9 - Checkout an item for branch B, date is not pushed forward
Lots of overlap here with bug 25723.. might be worth a look [U+1F609]
Created attachment 106987 [details] [review] Bug 26000: [alternate] Make exception_holidays cache with branch in key In light of 25723 offering a simpler solution here. This would just let us avoid backporting larger changes, but this can be marked as a duplicate if 25723 is preferred to this change
*** Bug 19426 has been marked as a duplicate of this bug. ***
So this is for stable branches only?
I think bug 25723 is a trivial backport for 20.05, but this patch is still useful for 19.11 and beyond.. I'd be interested to see what the remains do.. if they all choose to backport 25723 then this is entirely a duplicate and can be closed. I'll touch base with them.
I did not backport Bug 25723 to 19.11.x because it was framed as an enhancement. If this patch could be reworked on top of that for 19.11.x, I'd be happy to backport this fix as it sorts a bug.
Created attachment 107746 [details] [review] Bug 26000: Unit test
Created attachment 107747 [details] [review] Bug 26000: Make exception_holidays cache with branch in key In light of 25723 offering a simpler solution here. This would just let us avoid backporting larger changes, but this can be marked as a duplicate if 25723 is preferred to this change
(In reply to Aleisha Amohia from comment #8) > I did not backport Bug 25723 to 19.11.x because it was framed as an > enhancement. If this patch could be reworked on top of that for 19.11.x, I'd > be happy to backport this fix as it sorts a bug. These apply cleanly to 19.11.x and tests pass - you only need this or 25723, not both. It would be nice to get an SO on this one. Martin, could you check as you wrote the other fix? :-)
Created attachment 107762 [details] [review] Bug 26000: Unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 107763 [details] [review] Bug 26000: Make exception_holidays cache with branch in key In light of 25723 offering a simpler solution here. This would just let us avoid backporting larger changes, but this can be marked as a duplicate if 25723 is preferred to this change Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Passing QA Works well and is basically a simplified version of but 25723 for backport.
Sending to oldstable RM queue.
backported to 19.11.x for 19.11.09
Backported to 19.05.x branch for 19.05.15