Summary: | Add 'no_items' option to TransformMarcToKoha | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Searching | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | fridolin.somers, kyle, 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: |
21.11.00,21.05.02
|
|
Circulation function: | |||
Attachments: |
Bug 28384: Add 'no_items' option to TransformMarcToKoha
Bug 28384: Add 'no_items' option to TransformMarcToKoha Bug 28384: Add 'no_items' option to TransformMarcToKoha Bug 28384: (QA follow-up) Rearranging unit tests Bug 28384: (follow-up) TransformMarcToKohaOneField should allow zeroes |
Description
Nick Clemens (kidclamp)
2021-05-19 10:19:29 UTC
Created attachment 121146 [details] [review] Bug 28384: Add 'no_items' option to TransformMarcToKoha This patch adds a new option 'no_items' and uses it in the C4::Search::searchResults routine. We don't use the item info fetched here, so skipping those lines saves us time. Additionally, I fix an incorrect FIXME comment, and pass the ISBN returned by the routine above into GetNormalizedISBN to save another lookup TO test: 1 - Enable AmazonCoverImages system preference 2 - Search staff client with a term that returns books with covers 3 - Apply patch 4 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t 5 - Confirm searching works 6 - Confirm Amazon images display (normalized_isbn is used for these) Created attachment 121150 [details] [review] Bug 28384: Add 'no_items' option to TransformMarcToKoha This patch adds a new option 'no_items' and uses it in the C4::Search::searchResults routine. We don't use the item info fetched here, so skipping those lines saves us time. Additionally, I fix an incorrect FIXME comment, and pass the ISBN returned by the routine above into GetNormalizedISBN to save another lookup TO test: 1 - Enable AmazonCoverImages system preference 2 - Search staff client with a term that returns books with covers 3 - Apply patch 4 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t 5 - Confirm searching works 6 - Confirm Amazon images display (normalized_isbn is used for these) Signed-off-by: David Nind <david@davidnind.com> QAing Created attachment 122418 [details] [review] Bug 28384: Add 'no_items' option to TransformMarcToKoha This patch adds a new option 'no_items' and uses it in the C4::Search::searchResults routine. We don't use the item info fetched here, so skipping those lines saves us time. Additionally, I fix an incorrect FIXME comment, and pass the ISBN returned by the routine above into GetNormalizedISBN to save another lookup TO test: 1 - Enable AmazonCoverImages system preference 2 - Search staff client with a term that returns books with covers 3 - Apply patch 4 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t 5 - Confirm searching works 6 - Confirm Amazon images display (normalized_isbn is used for these) Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> [EDIT] Amended, replacing a tab character. Created attachment 122419 [details] [review] Bug 28384: (QA follow-up) Rearranging unit tests This does two things: [1] Rearranging makes clearing the cache twice no longer needed. [2] Preparing the ground for an additional refinement in the TransformMarcToKoha routine. Test plan: Run TransformMarcToKoha.t. Should fail now for: not ok 1 - Biblio field 510a not ok 5 - Biblio field returned when "no_items" passed Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 122420 [details] [review] Bug 28384: (follow-up) TransformMarcToKohaOneField should allow zeroes Until now, the test did not pass false values like '0' or ''. But we should pass '0' and not ''. Note that the test for control fields is a bit theoretical since we dont have control fields bound to Koha fields currently. The adjusted unit test in the former patch should now pass. Test plan: Run TransformMarcToKoha.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Since this change theoretically has a larger impact, I also tested the cataloguing editor, item editor. And run quite a few tests referring to AddBiblio or ModBiblio. (In reply to Nick Clemens from comment #0) > In C4::Search::searchResults - we ignore the item info returned, skipping > processing item lines can save us time The time savings will be absolutely minimal since this whole process runs in memory using cached values etc. Removed the follow-ups. Pushed to master for 21.11, thanks to everybody involved! Performance patch, backported to 21.05.x for 21.05.02 Enhancement not pushed to 20.11.x |