Bug 35579: Cache authorised value lookup by MARC field
authorDavid Cook <dcook@prosentient.com.au>
Fri, 15 Dec 2023 06:02:17 +0000 (06:02 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Fri, 12 Jan 2024 22:02:27 +0000 (22:02 +0000)
commit1c8291f8aed2d4bfd94548dfc33e2b24d18cc1de
treeada1b7791a522e8303b728cd46c68fc57ad0ed1c
parentf4eb54dd6bb8507c74e009ccfc893c43f51b44f9
Bug 35579: Cache authorised value lookup by MARC field

This patch adds a "get_descriptions_by_marc_field" method
which caches AuthorisedValue descriptions when searched by
MARC field, which is used when exporting MARC to CSV.

Test plan:
0. Do not apply the patch yet!
1. Go to http://localhost:8081/cgi-bin/koha/tools/csv-profiles.pl
2. Add a CSV profile with the default values and using the following for the "Profile MARC fields":
000|001|003|005|006|007|008|010|015|016|020|022|040|050|082|100|110|111|130|240|243|245|246|247|250|260|300|336|337|338|440|490|500|501|505|520|530|600|610|611|630|648|650|651|690|700|710|711|856|887|942|995|952|952$c
3. Create a new List
4. Add all the database's bibs to that list using SQL like the following (where the shelfnumber equals the number for your list):
insert into virtualshelfcontents (shelfnumber,biblionumber,borrowernumber) select 1,biblionumber,51 from biblio;
5. Go to that list in the staff interface
6. Download that list using your CSV profile
7. Apply the patch
8. koha-plack --reload kohadev
9. Download that list using your CSV profile
10. Note that the output is the same, but that the output completes much more quickly after applying the patch

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 78c0e8df8da008c87f28d9432e16790ce07eabc1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 423c24033999d2d098ae7c68956d3b583523500f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Record.pm
Koha/AuthorisedValues.pm