Summary: | Refactor MarcItemFieldsToOrder code to make adding more fields simpler | ||
---|---|---|---|
Product: | Koha | Reporter: | Kyle M Hall (khall) <kyle> |
Component: | Architecture, internals, and plumbing | Assignee: | Kyle M Hall (khall) <kyle> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | andrew, fridolin.somers, m.de.rooy, martin.renvoize |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
**Sponsored by** *ByWater Solutions*
|
Version(s) released in: |
23.11.00
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 34355, 35913, 33171, 35912 | ||
Attachments: |
Bug 33170: Refactor MARCItemFieldsToOrder to make adding more fields trivial
Bug 33170: Refactor MARCItemFieldsToOrder to make adding more fields trivial Bug 33170: Refactor MARCItemFieldsToOrder to make adding more fields trivial |
Description
Kyle M Hall (khall)
2023-03-08 16:10:08 UTC
Created attachment 147963 [details] [review] Bug 33170: Refactor MARCItemFieldsToOrder to make adding more fields trivial There is no need for this code to have a hard coded list of fields directly in the code. Any invalid keys would be skipped anyway. If we refactor this code then adding new fields will be much simpler. Test Plan: 1) Set up your MARCItemFieldsToOrder, verify everything is working 2) Apply this patch 3) Restart all the things! 4) Verify there has been no change to the MARCItemFieldsToOrder functionality Created attachment 151534 [details] [review] Bug 33170: Refactor MARCItemFieldsToOrder to make adding more fields trivial There is no need for this code to have a hard coded list of fields directly in the code. Any invalid keys would be skipped anyway. If we refactor this code then adding new fields will be much simpler. Test Plan: 1) Set up your MARCItemFieldsToOrder, verify everything is working 2) Apply this patch 3) Restart all the things! 4) Verify there has been no change to the MARCItemFieldsToOrder functionality Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Looks like this line might need similar attention somewhere too: my $infos = get_infos_syspref('MarcFieldsToOrder', $marcrecord, ['price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2','replacementprice']); This waited much too long already, so I wont complain about moving such routines to module level.. (Making them testable etc. etc.) (In reply to Kyle M Hall from comment #1) > > Test Plan: > 1) Set up your MARCItemFieldsToOrder, verify everything is working We could call this a lazy test plan :) The generic form is: Set it up and verify that all works. LOL Created attachment 155363 [details] [review] Bug 33170: Refactor MARCItemFieldsToOrder to make adding more fields trivial There is no need for this code to have a hard coded list of fields directly in the code. Any invalid keys would be skipped anyway. If we refactor this code then adding new fields will be much simpler. Test Plan: 1) Set up your MARCItemFieldsToOrder, verify everything is working 2) Apply this patch 3) Restart all the things! 4) Verify there has been no change to the MARCItemFieldsToOrder functionality Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Pushed to master for 23.11. Nice work everyone, thanks! Enhancement not pushed to 23.05.x |