Bug 22439 - Duplicated code in PrepHostMarcField and prepare_host_field
Summary: Duplicated code in PrepHostMarcField and prepare_host_field
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
: 30793 (view as bug list)
Depends on: 37305
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-01 09:06 UTC by paxed
Modified: 2024-07-17 10:30 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2019-03-01 09:06:13 UTC
The C4/Biblio.pm subroutines PrepHostMarcField and prepare_host_field both do the same thing, so should be merged.
Comment 1 paxed 2019-03-04 08:17:28 UTC
In addition:

1) prepare_host_field: if ( $field = $host->field('100') || $host->field('110') || $host->field('11') ) - the '11' should be '111'

2) prepare_host_field has a 240 -> 773b, which should be 250a -> 773b, as it is in PrepHostMarcField

3) There's a difference in how the 773a is set: prepare_host_field uses 100ab | 110ab | 11ab, but PrepHostMarcField uses 100a | 110a | 111a
Comment 2 Martin Renvoize (ashimema) 2024-07-17 10:13:10 UTC
*** Bug 30793 has been marked as a duplicate of this bug. ***
Comment 3 Martin Renvoize (ashimema) 2024-07-17 10:30:10 UTC
I remove C4::Biblio::prepare_host_field in bug 37305, opting to use the tested method I add to Koha::Biblio as `generate_marc_host_field` in bug 29560.

1) The 111 vs 11 mistake in prepare_marc_host is fixed in generate_marc_host_field already.
2) We set 773b t 250ab and 773s to 240a in generate_marc_host_field
3) We stick to 1XXab for 773a in generate_marc_host_field

The outstanding differences between PrepHostMarcField, for EasyAnalytics, and generate_marc_host_field are:

1) Subfield 0 is set to the host biblionumber
2) Subfield 9 is set to the host itemnumber
3) Subfield o is set to the host item barcode