@ -293,7 +293,7 @@ sub ModBiblio {
}
if ( C4::Context - > preference ( "CataloguingLog" ) ) {
my $ newrecord = GetMarcBiblio ( $ biblionumber ) ;
my $ newrecord = GetMarcBiblio ( { biblionumber = > $ biblionumber } ) ;
logaction ( "CATALOGUING" , "MODIFY" , $ biblionumber , "biblio BEFORE=>" . $ newrecord - > as_formatted ) ;
}
@ -1136,11 +1136,18 @@ sub GetMarcSubfieldStructureFromKohaField {
= head2 GetMarcBiblio
my $ record = GetMarcBiblio ( $ biblionumber , [ $ embeditems ] , [ $ opac ] ) ;
my $ record = GetMarcBiblio ( {
biblionumber = > $ biblionumber ,
embed_items = > $ embeditems ,
opac = > $ opac } ) ;
Returns MARC:: Record representing a biblio record , or C <undef> if the
biblionumber doesn ' t exist .
Both embed_items and opac are optional .
If embed_items is passed and is 1 , items are embedded .
If opac is passed and is 1 , the record is filtered as needed .
= over 4
= item C <$biblionumber>
@ -1161,9 +1168,16 @@ OpacHiddenItems to be applied.
= cut
sub GetMarcBiblio {
my $ biblionumber = shift ;
my $ embeditems = shift || 0 ;
my $ opac = shift || 0 ;
my ( $ params ) = @ _ ;
if ( not defined $ params ) {
carp 'GetMarcBiblio called without parameters' ;
return ;
}
my $ biblionumber = $ params - > { biblionumber } ;
my $ embeditems = $ params - > { embed_items } || 0 ;
my $ opac = $ params - > { opac } || 0 ;
if ( not defined $ biblionumber ) {
carp 'GetMarcBiblio called with undefined biblionumber' ;
@ -2181,7 +2195,7 @@ sub PrepHostMarcField {
$ marcflavour || = "MARC21" ;
require C4::Items ;
my $ hostrecord = GetMarcBiblio ( $ hostbiblionumber ) ;
my $ hostrecord = GetMarcBiblio ( { biblionumber = > $ hostbiblionumber } ) ;
my $ item = C4::Items:: GetItem ( $ hostitemnumber ) ;
my $ hostmarcfield ;
@ -2830,7 +2844,9 @@ sub ModZebra {
) ;
if ( $ op eq 'specialUpdate' ) {
unless ( $ record ) {
$ record = GetMarcBiblio ( $ biblionumber , 1 ) ;
$ record = GetMarcBiblio ( {
biblionumber = > $ biblionumber ,
embed_items = > 1 } ) ;
}
my $ records = [ $ record ] ;
$ indexer - > update_index_background ( [ $ biblionumber ] , [ $ record ] ) ;
@ -3443,7 +3459,7 @@ Generate the host item entry for an analytic child entry
sub prepare_host_field {
my ( $ hostbiblio , $ marcflavour ) = @ _ ;
$ marcflavour || = C4::Context - > preference ( 'marcflavour' ) ;
my $ host = GetMarcBiblio ( $ hostbiblio ) ;
my $ host = GetMarcBiblio ( { biblionumber = > $ hostbiblio } ) ;
# unfortunately as_string does not 'do the right thing'
# if field returns undef
my % sfd ;
@ -3581,7 +3597,7 @@ sub UpdateTotalIssues {
my ( $ biblionumber , $ increase , $ value ) = @ _ ;
my $ totalissues ;
my $ record = GetMarcBiblio ( $ biblionumber ) ;
my $ record = GetMarcBiblio ( { biblionumber = > $ biblionumber } ) ;
unless ( $ record ) {
carp "UpdateTotalIssues could not get biblio record" ;
return ;