Bug 18269

Summary: Move field mappings related code to Koha::FieldMapping[s]
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: katrin.fischer, kyle, veron
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17628
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 15449    
Attachments: Bug 18269: Add Koha::FieldMapping[s] packages
Bug 18269: Move field mappings related code to Koha::FieldMapping[s]
Bug 18269: Add Koha::FieldMapping[s] packages
Bug 18269: Move field mappings related code to Koha::FieldMapping[s]
Bug 18269: Add Koha::FieldMapping[s] packages
Bug 18269: Move field mappings related code to Koha::FieldMapping[s]

Description Jonathan Druart 2017-03-14 21:15:15 UTC
There are 3 subroutines in C4::Biblio that only do CRUD operations. They can be replaced with a new package Koha::FieldMapping[s]
Comment 1 Jonathan Druart 2017-03-14 21:21:25 UTC
Created attachment 61091 [details] [review]
Bug 18269: Add Koha::FieldMapping[s] packages
Comment 2 Jonathan Druart 2017-03-14 21:21:29 UTC
Created attachment 61092 [details] [review]
Bug 18269: Move field mappings related code to Koha::FieldMapping[s]

The 3 subroutines GetFieldMapping, SetFieldMapping and
DeleteFieldMapping from the C4::Biblio module were only used from the
field mappings admin page.
They can easily replaced with new packages Koha::FieldMappings based on
Koha::Object[s]

Test plan:
Add and delete field mappings (admin/fieldmapping.pl, Home ›
Administration › Keyword to MARC mapping).
Add an existing mapping > Nothing should be added

Note that this page has not been rewritten and you will not get any
feedbacks, but it's not the goal of this page to improve it.
Comment 3 Marc Véron 2017-03-15 09:35:05 UTC
Created attachment 61093 [details] [review]
Bug 18269: Add Koha::FieldMapping[s] packages

Tested both patches together, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Comment 4 Marc Véron 2017-03-15 09:36:20 UTC
Created attachment 61094 [details] [review]
Bug 18269: Move field mappings related code to Koha::FieldMapping[s]

The 3 subroutines GetFieldMapping, SetFieldMapping and
DeleteFieldMapping from the C4::Biblio module were only used from the
field mappings admin page.
They can easily replaced with new packages Koha::FieldMappings based on
Koha::Object[s]

Test plan:
Add and delete field mappings (admin/fieldmapping.pl, Home ›
Administration › Keyword to MARC mapping).
Add an existing mapping > Nothing should be added

Note that this page has not been rewritten and you will not get any
feedbacks, but it's not the goal of this page to improve it.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Comment 5 Nick Clemens (kidclamp) 2017-03-29 14:35:41 UTC
Created attachment 61681 [details] [review]
Bug 18269: Add Koha::FieldMapping[s] packages

Tested both patches together, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Nick Clemens (kidclamp) 2017-03-29 14:35:49 UTC
Created attachment 61682 [details] [review]
Bug 18269: Move field mappings related code to Koha::FieldMapping[s]

The 3 subroutines GetFieldMapping, SetFieldMapping and
DeleteFieldMapping from the C4::Biblio module were only used from the
field mappings admin page.
They can easily replaced with new packages Koha::FieldMappings based on
Koha::Object[s]

Test plan:
Add and delete field mappings (admin/fieldmapping.pl, Home ›
Administration › Keyword to MARC mapping).
Add an existing mapping > Nothing should be added

Note that this page has not been rewritten and you will not get any
feedbacks, but it's not the goal of this page to improve it.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Kyle M Hall 2017-03-31 11:00:40 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 8 Katrin Fischer 2017-04-02 16:19:24 UTC
This won't get ported back to 16.11.x as it is an enhancement.