Bug 37364: Add requested RDA handling to generate_marc_host_field

This patch adds handling for the 264 field in precedence to the 260 for
the generate_marc_host_field method and also adds subfields n and p to
the 245 handling.

Test plan
1) The routine is currently only called during bundle linking so...
1a) Creating a new bundle
   * Add a new bib record
   * Mark the bib record as a 'collection' type by setting leader
     position 7 to 'c'
   * Add a new item to this bib record
   * You should see a new 'Manage bundle' button available in the
     'Actions' column of the Holdings table.
   * Clicking 'Manage bundle' should expand the table to include a new
     row directly beneath this one.
   * Use the new 'Add to bundle' button that appears in this row to
     trigger a modal that allows entering the barcode of items you wish
     to add to the bundle
   * Ensure the 'Add MARC link' checkbox is checked to create 773 links
     and trigger the code above
2) Inspect the MARC record for the host biblio and confirm the 773 has
   been built.
3) Run unit tests to confirm they now pass

Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2024-07-17 09:43:52 +01:00 committed by Lucas Gass
parent f234fe5a1c
commit 300247d2c6
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 20 additions and 5 deletions

View File

@ -1944,10 +1944,25 @@ sub generate_marc_host_field {
}
# Publication
if ( $host_field = $marc_host->field('260') ) {
my $s = $host_field->as_string('abc');
if ($s) {
$sfd{d} = $s;
my @publication_fields = $marc_host->field('264');
@publication_fields = $marc_host->field('260') unless (@publication_fields);
my $index = 0;
for my $host_field (@publication_fields) {
# Use first entry unless we find a preferred indicator1 = 3
if ( $index == 0 ) {
my $s = $host_field->as_string('abc');
if ($s) {
$sfd{d} = $s;
}
$index++;
}
if ( $host_field->indicator(1) && ( $host_field->indicator(1) eq '3' ) ) {
my $s = $host_field->as_string('abc');
if ($s) {
$sfd{d} = $s;
}
last;
}
}
@ -1961,7 +1976,7 @@ sub generate_marc_host_field {
# Title
if ( $host_field = $marc_host->field('245') ) {
my $s = $host_field->as_string('ab');
my $s = $host_field->as_string('abnp');
if ($s) {
$sfd{t} = $s;
}