Bug 16539 - Koha::Cache is incorrectly caching single holidays
Summary: Koha::Cache is incorrectly caching single holidays
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P3 blocker (vote)
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on: 14522
Blocks:
  Show dependency treegraph
 
Reported: 2016-05-17 18:38 UTC by Nick Clemens (kidclamp)
Modified: 2019-06-27 09:24 UTC (History)
4 users (show)

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


Attachments
Bug 16539 - Koha::Cache is incorrectly caching single holidays (1.21 KB, patch)
2016-05-17 18:42 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 16539 - Koha::Cache is incorrectly caching single holidays (1.26 KB, patch)
2016-05-17 18:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 16539 - Koha::Cache is incorrectly caching single holidays (1.32 KB, patch)
2016-05-17 23:50 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 16539: Try to provide tests (2.25 KB, patch)
2016-05-18 14:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16539: Try to provide tests (2.29 KB, patch)
2016-05-20 15:41 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 16539 - Koha::Cache is incorrectly caching single holidays (1.39 KB, patch)
2016-05-20 15:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16539: Add tests (2.31 KB, patch)
2016-05-20 15:55 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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 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