Bug 31196

Summary: Key "default_value_for_mod_marc-" cleared from cache but not set anymore
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: arthur.suzuki, lucas, m.de.rooy, wainuiwitikapark
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31194
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.08, 21.11.15
Circulation function:
Attachments: Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls
Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls
Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls

Description Jonathan Druart 2022-07-20 07:38:33 UTC
We are seeing the following lines several times in the codebase
  $cache->clear_from_cache("default_value_for_mod_marc-");

But values are never set for this key.
Comment 1 Jonathan Druart 2022-07-20 07:59:16 UTC
Created attachment 137895 [details] [review]
Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls

We are seeing the following lines several times in the codebase
  $cache->clear_from_cache("default_value_for_mod_marc-");

But values are never set for this key.

Test plan:
Ask you, "Is the above correct?"
Use the correct 'git grep' and 'git log' and confirm the assertion.
Comment 2 Katrin Fischer 2022-07-24 21:28:40 UTC
The test plan is a bit too sparse for me.
Comment 3 Jonathan Druart 2022-10-25 09:18:21 UTC
Created attachment 142602 [details] [review]
Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls

We are seeing the following lines several times in the codebase
  $cache->clear_from_cache("default_value_for_mod_marc-");

But values are never set for this key.

Test plan:
Ask you, "Is the above correct?"
Use the correct 'git grep' and 'git log' and confirm the assertion.
Comment 4 Marcel de Rooy 2022-10-25 13:56:34 UTC
You should have a look at bug 23463 to know who forgot to remove them?
Comment 5 Marcel de Rooy 2022-10-25 13:58:39 UTC
misc/release_notes/release_notes_16_11_00.md:- [[13074]](http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13074) C4::Items::_build_default_values_for_mod_marc should use Koha::Cache

=> Interesting difference: the sub uses default_values but the key is called default_value

This was refactored to nowhere
Comment 6 Marcel de Rooy 2022-10-25 13:59:18 UTC
Created attachment 142611 [details] [review]
Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls

We are seeing the following lines several times in the codebase
  $cache->clear_from_cache("default_value_for_mod_marc-");

But values are never set for this key.

Test plan:
Ask you, "Is the above correct?"
Use the correct 'git grep' and 'git log' and confirm the assertion.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Marcel de Rooy 2022-10-25 14:00:38 UTC
Taking the liberty to combine SO and QA here.
Comment 8 Tomás Cohen Arazi (tcohen) 2022-10-25 14:20:48 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 9 Lucas Gass (lukeg) 2022-12-05 23:23:04 UTC
Backported to 22.05.x for upcoming 22.05.08
Comment 10 Arthur Suzuki 2022-12-16 16:02:31 UTC
applied to 21.11 for 21.11.15
Comment 11 Wainui Witika-Park 2023-03-15 01:06:19 UTC
Not backported to 21.05.x