Bug 16539

Summary: Koha::Cache is incorrectly caching single holidays
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Architecture, internals, and plumbingAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: blocker    
Priority: P3 CC: gwilliams, jonathan.druart, julian.maurice, kyle
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 14522    
Bug Blocks:    
Attachments: Bug 16539 - Koha::Cache is incorrectly caching single holidays
Bug 16539 - Koha::Cache is incorrectly caching single holidays
Bug 16539 - Koha::Cache is incorrectly caching single holidays
Bug 16539: Try to provide tests
Bug 16539: Try to provide tests
Bug 16539 - Koha::Cache is incorrectly caching single holidays
Bug 16539: Add tests

Description Nick Clemens (kidclamp) 2016-05-17 18:38:36 UTC
Bug 14522 introduced caching for single_holidays, however, when rebuilding the cache it is using self->branchcode to populate all of the holidays for the cache.
Comment 1 Nick Clemens (kidclamp) 2016-05-17 18:42:55 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall (khall) 2016-05-17 18:51:39 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2016-05-17 23:50:57 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2016-05-18 14:01:37 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-05-18 14:02:17 UTC
Nick, I have tried to provide tests for this change, but they pass even without your patch.
Could you have a look?
Comment 6 Nick Clemens (kidclamp) 2016-05-20 15:41:00 UTC Comment hidden (obsolete)
Comment 7 Nick Clemens (kidclamp) 2016-05-20 15:41:35 UTC
For me tests fail without patch and pass with it, back to signed off

(In reply to Jonathan Druart from comment #5)
> Nick, I have tried to provide tests for this change, but they pass even
> without your patch.
> Could you have a look?
Comment 8 Jonathan Druart 2016-05-20 15:55:43 UTC
Created attachment 51665 [details] [review]
Bug 16539 - Koha::Cache is incorrectly caching single holidays

This makes the loop add holidays for each bracnh instead of the calling
branch

To test:
I used memcached-tools to view the cache, clear the cache, and wait for
holidays to regnerate

Have a branches with different holidays
Clear the cache
Do a checkout
View the cache - one libraries holidays are repeated for all branches
Apply patch
Clear the cache
Do a checkout
Library holidays are correctly cached

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2016-05-20 15:55:47 UTC
Created attachment 51666 [details] [review]
Bug 16539: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Kyle M Hall (khall) 2016-05-23 16:52:59 UTC
Pushed to master for 16.05. Thanks Nick, Jonathan!
Comment 11 Julian Maurice 2016-05-25 08:23:18 UTC
Patches pushed to 3.22.x, will be in 3.22.7