Bug 16769

Summary: Koha::Cache->set_in_cache calls need to be standardised
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: brendan, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 16769: Uniformise calls to Koha::Cache->set_in_cache
Bug 16769: Uniformise calls to Koha::Cache->set_in_cache
Bug 16769: [QA Follow-up] Still found an occurrence
Bug 16769: [QA Follow-up] Remove unsupported deepcopy parameter
Bug 16769: Uniformise calls to Koha::Cache->set_in_cache
Bug 16769: [QA Follow-up] Still found an occurrence
Bug 16769: [QA Follow-up] Remove unsupported deepcopy parameter

Description Jonathan Druart 2016-06-18 14:04:00 UTC
Koha::Cache->set_in_cache supports old calls to this method. It is better to standardise all of the calls and support only one version.
Comment 1 Jonathan Druart 2016-06-18 14:08:02 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2016-07-27 14:17:47 UTC
Created attachment 53751 [details] [review]
Bug 16769: Uniformise calls to Koha::Cache->set_in_cache

From the POD of Koha::Cache->set_in_cache:
 # This is a bit of a hack to support the old API in case things still use it

Let's remove this hack and update old calls.

Test plan:
Look at the results of
  git grep set_in_cache
and confirm that there are no more version of the old call (without
hashref as third param)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2016-07-27 14:17:51 UTC
Created attachment 53752 [details] [review]
Bug 16769: [QA Follow-up] Still found an occurrence

Script svc/report did contain one old-style call.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2016-07-27 14:17:54 UTC
Created attachment 53753 [details] [review]
Bug 16769: [QA Follow-up] Remove unsupported deepcopy parameter

Routine C4/Koha/GetAuthorisedValues adds deepcopy => 1 to the options of
set_in_cache. This makes no sense (anymore?). Is not supported or passed
further. So better remove it.

Test plan:
Run t/db_dependent/Koha.t (with Test::Deep available to minimize confusion)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Nick Clemens 2016-10-04 09:57:08 UTC
Created attachment 56013 [details] [review]
Bug 16769: Uniformise calls to Koha::Cache->set_in_cache

From the POD of Koha::Cache->set_in_cache:
 # This is a bit of a hack to support the old API in case things still use it

Let's remove this hack and update old calls.

Test plan:
Look at the results of
  git grep set_in_cache
and confirm that there are no more version of the old call (without
hashref as third param)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Nick Clemens 2016-10-04 09:57:12 UTC
Created attachment 56014 [details] [review]
Bug 16769: [QA Follow-up] Still found an occurrence

Script svc/report did contain one old-style call.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Nick Clemens 2016-10-04 09:57:18 UTC
Created attachment 56015 [details] [review]
Bug 16769: [QA Follow-up] Remove unsupported deepcopy parameter

Routine C4/Koha/GetAuthorisedValues adds deepcopy => 1 to the options of
set_in_cache. This makes no sense (anymore?). Is not supported or passed
further. So better remove it.

Test plan:
Run t/db_dependent/Koha.t (with Test::Deep available to minimize confusion)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 8 Brendan Gallagher 2016-10-11 08:53:40 UTC
Pushed to Master - Should be in the november 16.11 release.  Thanks!