From 4d58adc65b7f3900804ca9f6cf9d8ec5dcdfae9a Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Tue, 24 Sep 2024 14:39:27 +0200 Subject: [PATCH] Bug 37996: Add field 773$0 to the link created by add_host_link Bug 29560 created a new function link_marc_host which is supposed to bind the fields : MARC21: 773$0 of the biblio to the 999$c of the bundle biblio UNIMARC: 461$0 of the biblio to the 001 of the bundle biblio This does not work for the MARC21 TEST PLAN: 1 - Apply the patch containing tests 2 - Run test in t/db_dependent/Koha/Biblio.t, they should fail on two tests 3 - Create a bundle on a biblio a 4 - Add an object to a bundle of a 5 - Check the field 773$0 -> it should be empty 6 - Apply patch 7 - Re-run tests 8 - Repeat 4&5 -> 773$0 should contain the biblionumber of a --- Koha/Biblio.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 8029be8..21f9b61 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -1856,6 +1856,9 @@ sub generate_marc_host_field { $sfd{w} = '(' . $host_field->data() . ')' . $sfd{w}; } } + if ( $host_field = $marc_host->field('999') ) { + $sfd{0} = $host_field->as_string('c'); + } $link_field = MARC::Field->new( 773, '0', ' ', %sfd ); } elsif ( $marcflavour eq 'UNIMARC' ) { -- 2.30.2