Bug 39158 - Reduce code duplication in marc_records_to_documents
Summary: Reduce code duplication in marc_records_to_documents
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: David Gustafsson
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-18 22:53 UTC by David Gustafsson
Modified: 2025-02-18 23:06 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 39158: Reduce code duplication in marc_records_to_documents (10.11 KB, patch)
2025-02-18 23:01 UTC, David Gustafsson
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Gustafsson 2025-02-18 22:53:50 UTC
There is currently a block in Koha::SearchEngine::Elasticsearch::marc_records_to_documents that in my opinion should be brokwn out to its own method for increased maintainability and readability. It's easily done that these two blocks will drift apart with time (when they should be the same), fixing a bug in one place, forgetting in another etc. Here is a patch to fix this.
Comment 1 David Gustafsson 2025-02-18 23:01:25 UTC
Created attachment 178302 [details] [review]
Bug 39158: Reduce code duplication in marc_records_to_documents

Refactor marc_record_to_documents to avoid code duplicaiton.

To test:
1) Verify tests in t/db_dependant/Koha/SearchEngine/Elasticsearch.t all
   pass
2) Apply patch
3) Veriy tests in t/db_dependant/Koha/SearchEngine/Elasticsearch.t
   still pass