@@ -, +, @@ --- C4/ILSDI/Services.pm | 2 +- Koha/BiblioUtils.pm | 4 ++-- Koha/OAI/Server/Repository.pm | 7 ++++++- Koha/SearchEngine/Elasticsearch/Indexer.pm | 2 +- basket/downloadcart.pl | 2 +- basket/sendbasket.pl | 2 +- catalogue/ISBDdetail.pl | 13 ++----------- catalogue/MARCdetail.pl | 2 +- catalogue/export.pl | 2 +- misc/batchRebuildItemsTables.pl | 2 +- misc/migration_tools/rebuild_zebra.pl | 2 +- opac/opac-downloadcart.pl | 4 ++-- opac/opac-export.pl | 4 ++-- opac/opac-sendbasket.pl | 4 ++-- opac/opac-sendshelf.pl | 4 ++-- opac/opac-tags.pl | 4 ++-- opac/opac-user.pl | 8 +++++++- serials/subscription-add.pl | 4 ++-- svc/bib | 4 ++-- svc/new_bib | 2 +- tools/showdiffmarc.pl | 2 +- virtualshelves/downloadshelf.pl | 2 +- virtualshelves/sendshelf.pl | 2 +- 23 files changed, 43 insertions(+), 41 deletions(-) --- a/C4/ILSDI/Services.pm +++ a/C4/ILSDI/Services.pm @@ -218,7 +218,7 @@ sub GetRecords { my $biblioitem = $biblio->biblioitem->unblessed; - my $record = $biblio->metadata->record({ embed_items => 1 }); + my $record = $biblio->metadata_record({ embed_items => 1 }); if ($record) { $biblioitem->{marcxml} = $record->as_xml_record(); } --- a/Koha/BiblioUtils.pm +++ a/Koha/BiblioUtils.pm @@ -146,7 +146,7 @@ sub get_all_biblios_iterator { my $row = $rs->next(); return if !$row; my $next = eval { - my $marc = $row->metadata->record({ embed_items => 1 }); + my $marc = $row->metadata_record({ embed_items => 1 }); $class->new($marc, $row->biblionumber); }; if ($@) { @@ -183,7 +183,7 @@ sub get_marc_biblio { my ($class, $bibnum, %options) = @_; my $record = Koha::Biblios->find($bibnum) - ->metadata->record( { $options{item_data} ? ( embed_items => 1 ) : () } ); + ->metadata_record( { $options{item_data} ? ( embed_items => 1 ) : () } ); return $record; } --- a/Koha/OAI/Server/Repository.pm +++ a/Koha/OAI/Server/Repository.pm @@ -178,7 +178,12 @@ sub get_biblio_marcxml { } my $biblio = Koha::Biblios->find($biblionumber); - my $record = $biblio->metadata->record({ embed_items => $with_items, opac => 1 }); + my $record = $biblio->metadata_record( + { + embed_items => $with_items, + interface => 'opac' + } + ); if ( $expanded_avs ) { my $frameworkcode = GetFrameworkCode($biblionumber) || ''; my $record_processor = Koha::RecordProcessor->new( --- a/Koha/SearchEngine/Elasticsearch/Indexer.pm +++ a/Koha/SearchEngine/Elasticsearch/Indexer.pm @@ -341,7 +341,7 @@ sub _get_record { if ( $self->index eq $Koha::SearchEngine::BIBLIOS_INDEX ) { my $biblio = Koha::Biblios->find($record_id); - $record = $biblio->metadata->record( { embed_items => 1 } ) + $record = $biblio->metadata_record( { embed_items => 1 } ) if $biblio; } else { $record = C4::AuthoritiesMarc::GetAuthority($record_id); --- a/basket/downloadcart.pl +++ a/basket/downloadcart.pl @@ -64,7 +64,7 @@ if ($bib_list && $format) { foreach my $biblionumber (@bibs) { my $biblio = Koha::Biblios->find($biblionumber); - my $record = $biblio->metadata->record({ embed_items => 1 }); + my $record = $biblio->metadata_record({ embed_items => 1 }); next unless $record; if ($format eq 'iso2709') { --- a/basket/sendbasket.pl +++ a/basket/sendbasket.pl @@ -71,7 +71,7 @@ if ( $email_add ) { my $biblio = Koha::Biblios->find( $biblionumber ) or next; my $dat = $biblio->unblessed; - my $record = $biblio->metadata->record({ embed_items => 1 }); + my $record = $biblio->metadata_record({ embed_items => 1 }); my $marcauthorsarray = $biblio->get_marc_contributors; my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); --- a/catalogue/ISBDdetail.pl +++ a/catalogue/ISBDdetail.pl @@ -76,8 +76,8 @@ unless ( $biblionumber && $biblio ) { exit; } -my $record = $biblio->metadata->record({ embed_items => 1 }); - +my $record = + $biblio->metadata_record( { embed_items => 1, interface => 'intranet' } ); if ( not defined $record ) { # biblionumber invalid -> report and exit $template->param( unknownbiblionumber => 1, @@ -88,15 +88,6 @@ if ( not defined $record ) { } my $framework = $biblio->frameworkcode; -my $record_processor = Koha::RecordProcessor->new({ - filters => 'ViewPolicy', - options => { - interface => 'intranet', - frameworkcode => $framework - }, -}); -$record_processor->process($record); - my $res = GetISBDView({ 'record' => $record, 'template' => 'intranet', --- a/catalogue/MARCdetail.pl +++ a/catalogue/MARCdetail.pl @@ -90,7 +90,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( ); my $biblio_object = Koha::Biblios->find( $biblionumber ); # FIXME Should replace $biblio -my $record = $biblio_object->metadata->record({ embed_items => 1 }); +my $record = $biblio_object->metadata_record({ embed_items => 1 }); if ( not defined $record ) { # biblionumber invalid -> report and exit --- a/catalogue/export.pl +++ a/catalogue/export.pl @@ -28,7 +28,7 @@ if ($op eq "export") { my $file_pre = "bib-"; my $biblio = Koha::Biblios->find($biblionumber); - my $marc = $biblio->metadata->record({ embed_items => 1 }); + my $marc = $biblio->metadata_record({ embed_items => 1 }); if( C4::Context->preference('DefaultSaveRecordFileID') eq 'controlnumber' ){ my $marcflavour = C4::Context->preference('marcflavour'); #FIXME This option is required but does not change control num behaviour --- a/misc/batchRebuildItemsTables.pl +++ a/misc/batchRebuildItemsTables.pl @@ -74,7 +74,7 @@ while ( my ( $biblionumber, $biblioitemnumber, $frameworkcode ) = $sth->fetchrow $count++; warn $count unless $count % 1000; my $biblio = Koha::Biblios->find($biblionumber); - my $record = $biblio->metadata->record({ embed_items => 1 }); + my $record = $biblio->metadata_record({ embed_items => 1 }); unless ($record) { push @errors, "bad record biblionumber $biblionumber"; next; } --- a/misc/migration_tools/rebuild_zebra.pl +++ a/misc/migration_tools/rebuild_zebra.pl @@ -683,7 +683,7 @@ sub get_raw_marc_record { if ($record_type eq 'biblio') { eval { my $biblio = Koha::Biblios->find($record_number); - $marc = $biblio->metadata->record({ embed_items => 1 }); + $marc = $biblio->metadata_record({ embed_items => 1 }); }; if ($@ || !$marc) { # here we do warn since catching an exception --- a/opac/opac-downloadcart.pl +++ a/opac/opac-downloadcart.pl @@ -77,10 +77,10 @@ if ($bib_list && $format) { foreach my $biblionumber (@bibs) { my $biblio = Koha::Biblios->find($biblionumber); - my $record = $biblio->metadata->record( + my $record = $biblio->metadata_record( { embed_items => 1, - opac => 1, + interface => 'opac', patron => $patron, } ); --- a/opac/opac-export.pl +++ a/opac/opac-export.pl @@ -54,10 +54,10 @@ if ($userenv) { my $include_items = ($format =~ /bibtex/) ? 0 : 1; my $biblio = Koha::Biblios->find($biblionumber); my $marc = $biblio - ? $biblio->metadata->record( + ? $biblio->metadata_record( { embed_items => 1, - opac => 1, + interface => 'opac', patron => $patron, } ) --- a/opac/opac-sendbasket.pl +++ a/opac/opac-sendbasket.pl @@ -75,10 +75,10 @@ if ( $email_add ) { my $biblio = Koha::Biblios->find( $biblionumber ) or next; my $dat = $biblio->unblessed; - my $record = $biblio->metadata->record( + my $record = $biblio->metadata_record( { embed_items => 1, - opac => 1, + interface => 'opac', patron => $patron, } ); --- a/opac/opac-sendshelf.pl +++ a/opac/opac-sendshelf.pl @@ -81,10 +81,10 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { my $biblionumber = $content->biblionumber; my $biblio = Koha::Biblios->find( $biblionumber ) or next; my $dat = $biblio->unblessed; - my $record = $biblio->metadata->record( + my $record = $biblio->metadata_record( { embed_items => 1, - opac => 1, + iinterface => 'opac', patron => $patron, } ); --- a/opac/opac-tags.pl +++ a/opac/opac-tags.pl @@ -250,10 +250,10 @@ if ($loggedinuser) { foreach my $tag (@$my_tags) { $tag->{visible} = 0; my $biblio = Koha::Biblios->find( $tag->{biblionumber} ); - my $record = $biblio->metadata->record( + my $record = $biblio->metadata_record( { embed_items => 1, - opac => 1, + interface => 'opac', patron => $patron, } ); --- a/opac/opac-user.pl +++ a/opac/opac-user.pl @@ -283,7 +283,13 @@ if ( $pending_checkouts->count ) { # Useless test my $isbn = GetNormalizedISBN($issue->{'isbn'}); $issue->{normalized_isbn} = $isbn; - my $marcrecord = $biblio_object->metadata->record({ embed_items => 1, opac => 1, patron => $patron,}); + my $marcrecord = $biblio_object->metadata_record( + { + embed_items => 1, + interface => 'opac', + patron => $patron + } + ); $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') ); # My Summary HTML --- a/serials/subscription-add.pl +++ a/serials/subscription-add.pl @@ -365,7 +365,7 @@ sub redirect_add_subscription { my @additional_fields; my $biblio = Koha::Biblios->find($biblionumber); - my $record = $biblio->metadata->record({ embed_items => 1 }); + my $record = $biblio->metadata_record({ embed_items => 1 }); my $subscription_fields = Koha::AdditionalFields->search({ tablename => 'subscription' }); while ( my $field = $subscription_fields->next ) { my $value = $query->param('additional_field_' . $field->id); @@ -485,7 +485,7 @@ sub redirect_mod_subscription { my @additional_fields; my $biblio = Koha::Biblios->find($biblionumber); - my $record = $biblio->metadata->record({ embed_items => 1 }); + my $record = $biblio->metadata_record({ embed_items => 1 }); my $subscription_fields = Koha::AdditionalFields->search({ tablename => 'subscription' }); while ( my $field = $subscription_fields->next ) { my $value = $query->param('additional_field_' . $field->id); --- a/svc/bib +++ a/svc/bib @@ -67,7 +67,7 @@ sub fetch_bib { my $query = shift; my $biblionumber = shift; my $biblio = Koha::Biblios->find( $biblionumber ); - my $record = $biblio->metadata->record({ embed_items => scalar $query->param('items') }); + my $record = $biblio->metadata_record({ embed_items => scalar $query->param('items') }); if (defined $record) { print $query->header(-type => 'text/xml',-charset => 'utf-8',); print $record->as_xml_record(); @@ -117,7 +117,7 @@ sub update_bib { C4::Biblio::ModBiblio( $record, $biblionumber, $frameworkcode ); my $biblio = Koha::Biblios->find( $biblionumber ); - my $new_record = $biblio->metadata->record({ embed_items => scalar $query->url_param('items') }); + my $new_record = $biblio->metadata_record({ embed_items => scalar $query->url_param('items') }); $result->{'status'} = "ok"; $result->{'biblionumber'} = $biblionumber; --- a/svc/new_bib +++ a/svc/new_bib @@ -88,7 +88,7 @@ sub add_bib { } $biblio = Koha::Biblios->find( $biblionumber ); - $new_record = $biblio->metadata->record({ embed_items => scalar $query->url_param('items') }); + $new_record = $biblio->metadata_record({ embed_items => scalar $query->url_param('items') }); $result->{'status'} = "ok"; $result->{'biblionumber'} = $biblionumber; my $xml = $new_record->as_xml_record(); --- a/tools/showdiffmarc.pl +++ a/tools/showdiffmarc.pl @@ -62,7 +62,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( if ( $type eq 'biblio' ) { my $biblio = Koha::Biblios->find( $recordid ); - $record = $biblio->metadata->record({ embed_items => 1 }); + $record = $biblio->metadata_record({ embed_items => 1 }); $recordTitle = $biblio->title; } elsif ( $type eq 'auth' ) { --- a/virtualshelves/downloadshelf.pl +++ a/virtualshelves/downloadshelf.pl @@ -69,7 +69,7 @@ if ($shelfid && $format) { while ( my $content = $contents->next ) { my $biblionumber = $content->biblionumber; my $biblio = Koha::Biblios->find($biblionumber); - my $record = $biblio->metadata->record({ embed_items => 1 }); + my $record = $biblio->metadata_record({ embed_items => 1 }); if ($format eq 'iso2709') { $output .= $record->as_usmarc(); } --- a/virtualshelves/sendshelf.pl +++ a/virtualshelves/sendshelf.pl @@ -78,7 +78,7 @@ if ($to_address) { my $biblionumber = $content->biblionumber; my $biblio = Koha::Biblios->find( $biblionumber ) or next; my $dat = $biblio->unblessed; - my $record = $biblio->metadata->record({ embed_items => 1 }); + my $record = $biblio->metadata_record({ embed_items => 1 }); my $marcauthorsarray = $biblio->get_marc_contributors; my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); --