From 59f6abf66485a68ed9c3374e18a84513a7261fb1 Mon Sep 17 00:00:00 2001 From: Janusz Kaczmarek Date: Tue, 14 Mar 2023 22:30:31 +0100 Subject: [PATCH] Bug 33231: (Bug 30813 follow-up) No publication date nor edition statements in Z39.50 biblio search results After executing Z39.50 search, the result table is not populated with publication dates. This is the result of code refactoring made by Bug 30813. The removed function _add_rowdata treated in special way the publication date putting it in $row in under special, non MARC variant dependent key 'date'--since the z3950_search.tt looks under breeding_loo.date. Same effect (no data in the result table) with edition statement. Reason: editionstatement coming from TransformMarcToKoha vs edition expected by z3950_search.tt. Test plan: ========== 1. Have a Koha instance with some Z39.50 servers defined. 2. In Cataloging, perform a Z39.50 search for any term. 3. In the result table you would not get the publication dates nor edition statement (if present in the record). 4. Apply the patch. 5. Repeat the search. 6. You should see the publication dates (according to the current mapping, i.e. for MARC 21 coming from 260 $c or 264 $c subfield) and edition statements from the records found. Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 7849a7e75f3df51b362f84e083899c99781feb58) Signed-off-by: Matt Blenkinsop --- C4/Breeding.pm | 4 +++- .../intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/Breeding.pm b/C4/Breeding.pm index f55f6e34b1..8c164c460f 100644 --- a/C4/Breeding.pm +++ b/C4/Breeding.pm @@ -307,8 +307,10 @@ sub _handle_one_result { my $row; if( $breedingid ){ my @kohafields = ('biblio.title','biblio.author','biblioitems.isbn','biblioitems.lccn','biblioitems.editionstatement'); - push @kohafields, C4::Context->preference('marcflavour') eq "MARC21" ? 'biblio.copyrightdate' : 'biblioitems.publicationyear'; + my $date_label = C4::Context->preference('marcflavour') eq "MARC21" ? 'biblio.copyrightdate' : 'biblioitems.publicationyear'; + push @kohafields, $date_label; $row = C4::Biblio::TransformMarcToKoha({ record => $marcrecord, kohafields => \@kohafields, limit_table => 'no_items' }); + $row->{date} = $row->{ substr( $date_label, index( $date_label, '.' ) + 1 ) }; $row->{biblionumber} = $bib; $row->{server} = $servhref->{servername}; $row->{breedingid} = $breedingid; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt index b1c5cbcfc2..e2a5d4141c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt @@ -172,7 +172,7 @@ [% breeding_loo.title | html %] [% breeding_loo.author | html %] [% breeding_loo.date | html %] - [% breeding_loo.edition | html %] + [% breeding_loo.editionstatement | html %] [% breeding_loo.isbn | html %] [% breeding_loo.lccn | html %] [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %] -- 2.39.5