Summary: | Marc subfield structure should be cached using Koha::Cache | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | abl, bgkriegel, f.demians, hagud, kyle, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16365 | ||
Change sponsored?: | --- | Patch complexity: | Medium patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 13074 | ||
Bug Blocks: | 7172, 8089, 17201 | ||
Attachments: |
Bug 16431: Use Koha::Cache to cache marc subfield structure
Bug 16431: Use Koha::Cache to cache marc subfield structure Bug 16431: Use Koha::Cache to cache marc subfield structure |
Description
Jonathan Druart
2016-05-03 13:33:40 UTC
Created attachment 51139 [details] [review] Bug 16431: Use Koha::Cache to cache marc subfield structure The marc subfield structure is currently cached using a global variable of C4::Context. The infos are retrieved every time a new context is created. This patch suggests to use Koha::Cache instead. To achieve this goal, a new subroutine is created C4::Biblio::GetMarcSubfieldStructure, it will be called from code which needs to get the marc subfield structure. GetMarcFromKohaField, GetMarcSubfieldStructureFromKohaField, TransformKohaToMarc and _get_inverted_marc_field_map are modified accordingly and the cache is cleared when the table is updated (from the 3 pl scripts modified by this patch). The caching done in C4::Context (marcfromkohafield) is removed. Test plan: Play with the marc subfield structure (in the administration module), then add and edit records and make sure everything went fine. Master is moving fast fatal: sha1 information is lacking or useless (admin/biblio_framework.pl). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 16431: Use Koha::Cache to cache marc subfield structure Sorry, forgot the dependency. Created attachment 51380 [details] [review] Bug 16431: Use Koha::Cache to cache marc subfield structure The marc subfield structure is currently cached using a global variable of C4::Context. The infos are retrieved every time a new context is created. This patch suggests to use Koha::Cache instead. To achieve this goal, a new subroutine is created C4::Biblio::GetMarcSubfieldStructure, it will be called from code which needs to get the marc subfield structure. GetMarcFromKohaField, GetMarcSubfieldStructureFromKohaField, TransformKohaToMarc and _get_inverted_marc_field_map are modified accordingly and the cache is cleared when the table is updated (from the 3 pl scripts modified by this patch). The caching done in C4::Context (marcfromkohafield) is removed. Test plan: Play with the marc subfield structure (in the administration module), then add and edit records and make sure everything went fine. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Everything works as expected on my functional tests. I'm really happy to see the patch introduces relevant tests for previously untested functions. Created attachment 52813 [details] [review] Bug 16431: Use Koha::Cache to cache marc subfield structure The marc subfield structure is currently cached using a global variable of C4::Context. The infos are retrieved every time a new context is created. This patch suggests to use Koha::Cache instead. To achieve this goal, a new subroutine is created C4::Biblio::GetMarcSubfieldStructure, it will be called from code which needs to get the marc subfield structure. GetMarcFromKohaField, GetMarcSubfieldStructureFromKohaField, TransformKohaToMarc and _get_inverted_marc_field_map are modified accordingly and the cache is cleared when the table is updated (from the 3 pl scripts modified by this patch). The caching done in C4::Context (marcfromkohafield) is removed. Test plan: Play with the marc subfield structure (in the administration module), then add and edit records and make sure everything went fine. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Everything works as expected on my functional tests. I'm really happy to see the patch introduces relevant tests for previously untested functions. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master for 16.11, thanks Jonathan! Pushed in 16.05. Will be in 16.05.02. |