From 6b9b778b1bc09eeb7d6e982a6fd5420b2209a641 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Wed, 4 Feb 2009 15:55:49 -0600 Subject: [PATCH] GetMarcFromKohaField needs 2 args, or there's no point. GetMarcFromKohaField returns (0,0) without the $frameworkcode argument. Note the argument can be "", but it must not be undefined. Signed-off-by: Galen Charlton --- C4/Biblio.pm | 4 ++-- C4/Search.pm | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 54d3cabea7..44d9fdbc7f 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2217,7 +2217,7 @@ sub _DelBiblioNoZebra { if ($server eq 'biblioserver') { %index=GetNoZebraIndexes; # get title of the record (to store the 10 first letters with the index) - my ($titletag,$titlesubfield) = GetMarcFromKohaField('biblio.title'); + my ($titletag,$titlesubfield) = GetMarcFromKohaField('biblio.title', ''); # FIXME: should be GetFrameworkCode($biblionumber) ?? $title = lc($record->subfield($titletag,$titlesubfield)); } else { # for authorities, the "title" is the $a mainentry @@ -2311,7 +2311,7 @@ sub _AddBiblioNoZebra { if ($server eq 'biblioserver') { %index=GetNoZebraIndexes; # get title of the record (to store the 10 first letters with the index) - my ($titletag,$titlesubfield) = GetMarcFromKohaField('biblio.title'); + my ($titletag,$titlesubfield) = GetMarcFromKohaField('biblio.title', ''); # FIXME: should be GetFrameworkCode($biblionumber) ?? $title = lc($record->subfield($titletag,$titlesubfield)); } else { # warn "server : $server"; diff --git a/C4/Search.pm b/C4/Search.pm index ecb1e77b1d..f950215706 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1947,15 +1947,13 @@ sub NZorder { my ( $biblionumber, $title ) = split /,/, $_; my $record = GetMarcBiblio($biblionumber); my $callnumber; - my ( $callnumber_tag, $callnumber_subfield ) = - GetMarcFromKohaField( $dbh, 'items.itemcallnumber' ); - ( $callnumber_tag, $callnumber_subfield ) = - GetMarcFromKohaField('biblioitems.callnumber') - unless $callnumber_tag; + my $frameworkcode = GetFrameworkCode($biblionumber); + my ( $callnumber_tag, $callnumber_subfield ) = GetMarcFromKohaField( 'items.itemcallnumber', $frameworkcode); + ( $callnumber_tag, $callnumber_subfield ) = GetMarcFromKohaField('biblioitems.callnumber', $frameworkcode) + unless $callnumber_tag; if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { $callnumber = $record->subfield( '200', 'f' ); - } - else { + } else { $callnumber = $record->subfield( '100', 'a' ); } @@ -2169,8 +2167,8 @@ sub ModBiblios { $tag = $tag . $subfield; undef $subfield; } - my ( $bntag, $bnsubf ) = GetMarcFromKohaField('biblio.biblionumber'); - my ( $itemtag, $itemsubf ) = GetMarcFromKohaField('items.itemnumber'); + my ( $bntag, $bnsubf ) = GetMarcFromKohaField('biblio.biblionumber', ''); + my ( $itemtag, $itemsubf ) = GetMarcFromKohaField('items.itemnumber', ''); if ($tag eq $itemtag) { # do not allow the embedded item tag to be # edited from here -- 2.39.5