View | Details | Raw Unified | Return to bug 31224
Collapse All | Expand All

(-)a/C4/ILSDI/Services.pm (-1 / +1 lines)
Lines 218-224 sub GetRecords { Link Here
218
218
219
        my $biblioitem = $biblio->biblioitem->unblessed;
219
        my $biblioitem = $biblio->biblioitem->unblessed;
220
220
221
        my $record = $biblio->metadata->record({ embed_items => 1 });
221
        my $record = $biblio->metadata_record({ embed_items => 1 });
222
        if ($record) {
222
        if ($record) {
223
            $biblioitem->{marcxml} = $record->as_xml_record();
223
            $biblioitem->{marcxml} = $record->as_xml_record();
224
        }
224
        }
(-)a/Koha/BiblioUtils.pm (-2 / +2 lines)
Lines 146-152 sub get_all_biblios_iterator { Link Here
146
            my $row = $rs->next();
146
            my $row = $rs->next();
147
            return if !$row;
147
            return if !$row;
148
            my $next = eval {
148
            my $next = eval {
149
                my $marc = $row->metadata->record({ embed_items => 1 });
149
                my $marc = $row->metadata_record({ embed_items => 1 });
150
                $class->new($marc, $row->biblionumber);
150
                $class->new($marc, $row->biblionumber);
151
            };
151
            };
152
            if ($@) {
152
            if ($@) {
Lines 183-189 sub get_marc_biblio { Link Here
183
    my ($class, $bibnum, %options) = @_;
183
    my ($class, $bibnum, %options) = @_;
184
184
185
    my $record = Koha::Biblios->find($bibnum)
185
    my $record = Koha::Biblios->find($bibnum)
186
      ->metadata->record( { $options{item_data} ? ( embed_items => 1 ) : () } );
186
      ->metadata_record( { $options{item_data} ? ( embed_items => 1 ) : () } );
187
    return $record;
187
    return $record;
188
}
188
}
189
189
(-)a/Koha/OAI/Server/Repository.pm (-1 / +6 lines)
Lines 178-184 sub get_biblio_marcxml { Link Here
178
    }
178
    }
179
179
180
    my $biblio = Koha::Biblios->find($biblionumber);
180
    my $biblio = Koha::Biblios->find($biblionumber);
181
    my $record = $biblio->metadata->record({ embed_items => $with_items, opac => 1 });
181
    my $record = $biblio->metadata_record(
182
        {
183
            embed_items => $with_items,
184
            interface   => 'opac'
185
        }
186
    );
182
    if ( $expanded_avs ) {
187
    if ( $expanded_avs ) {
183
        my $frameworkcode = GetFrameworkCode($biblionumber) || '';
188
        my $frameworkcode = GetFrameworkCode($biblionumber) || '';
184
        my $record_processor = Koha::RecordProcessor->new(
189
        my $record_processor = Koha::RecordProcessor->new(
(-)a/Koha/SearchEngine/Elasticsearch/Indexer.pm (-1 / +1 lines)
Lines 341-347 sub _get_record { Link Here
341
341
342
    if ( $self->index eq $Koha::SearchEngine::BIBLIOS_INDEX ) {
342
    if ( $self->index eq $Koha::SearchEngine::BIBLIOS_INDEX ) {
343
        my $biblio = Koha::Biblios->find($record_id);
343
        my $biblio = Koha::Biblios->find($record_id);
344
        $record = $biblio->metadata->record( { embed_items => 1 } )
344
        $record = $biblio->metadata_record( { embed_items => 1 } )
345
          if $biblio;
345
          if $biblio;
346
    } else {
346
    } else {
347
        $record = C4::AuthoritiesMarc::GetAuthority($record_id);
347
        $record = C4::AuthoritiesMarc::GetAuthority($record_id);
(-)a/basket/downloadcart.pl (-1 / +1 lines)
Lines 64-70 if ($bib_list && $format) { Link Here
64
        foreach my $biblionumber (@bibs) {
64
        foreach my $biblionumber (@bibs) {
65
65
66
            my $biblio = Koha::Biblios->find($biblionumber);
66
            my $biblio = Koha::Biblios->find($biblionumber);
67
            my $record = $biblio->metadata->record({ embed_items => 1 });
67
            my $record = $biblio->metadata_record({ embed_items => 1 });
68
            next unless $record;
68
            next unless $record;
69
69
70
            if ($format eq 'iso2709') {
70
            if ($format eq 'iso2709') {
(-)a/basket/sendbasket.pl (-1 / +1 lines)
Lines 71-77 if ( $email_add ) { Link Here
71
71
72
        my $biblio           = Koha::Biblios->find( $biblionumber ) or next;
72
        my $biblio           = Koha::Biblios->find( $biblionumber ) or next;
73
        my $dat              = $biblio->unblessed;
73
        my $dat              = $biblio->unblessed;
74
        my $record           = $biblio->metadata->record({ embed_items => 1 });
74
        my $record           = $biblio->metadata_record({ embed_items => 1 });
75
        my $marcauthorsarray = $biblio->get_marc_contributors;
75
        my $marcauthorsarray = $biblio->get_marc_contributors;
76
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
76
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
77
77
(-)a/catalogue/ISBDdetail.pl (-11 / +2 lines)
Lines 76-83 unless ( $biblionumber && $biblio ) { Link Here
76
   exit;
76
   exit;
77
}
77
}
78
78
79
my $record = $biblio->metadata->record({ embed_items => 1 });
79
my $record =
80
80
  $biblio->metadata_record( { embed_items => 1, interface => 'intranet' } );
81
if ( not defined $record ) {
81
if ( not defined $record ) {
82
       # biblionumber invalid -> report and exit
82
       # biblionumber invalid -> report and exit
83
       $template->param( unknownbiblionumber => 1,
83
       $template->param( unknownbiblionumber => 1,
Lines 88-102 if ( not defined $record ) { Link Here
88
}
88
}
89
89
90
my $framework = $biblio->frameworkcode;
90
my $framework = $biblio->frameworkcode;
91
my $record_processor = Koha::RecordProcessor->new({
92
    filters => 'ViewPolicy',
93
    options => {
94
        interface => 'intranet',
95
        frameworkcode => $framework
96
    },
97
});
98
$record_processor->process($record);
99
100
my $res = GetISBDView({
91
my $res = GetISBDView({
101
    'record'    => $record,
92
    'record'    => $record,
102
    'template'  => 'intranet',
93
    'template'  => 'intranet',
(-)a/catalogue/MARCdetail.pl (-1 / +1 lines)
Lines 90-96 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
90
);
90
);
91
91
92
my $biblio_object = Koha::Biblios->find( $biblionumber ); # FIXME Should replace $biblio
92
my $biblio_object = Koha::Biblios->find( $biblionumber ); # FIXME Should replace $biblio
93
my $record = $biblio_object->metadata->record({ embed_items => 1 });
93
my $record = $biblio_object->metadata_record({ embed_items => 1 });
94
94
95
if ( not defined $record ) {
95
if ( not defined $record ) {
96
    # biblionumber invalid -> report and exit
96
    # biblionumber invalid -> report and exit
(-)a/catalogue/export.pl (-1 / +1 lines)
Lines 28-34 if ($op eq "export") { Link Here
28
            my $file_pre = "bib-";
28
            my $file_pre = "bib-";
29
29
30
            my $biblio = Koha::Biblios->find($biblionumber);
30
            my $biblio = Koha::Biblios->find($biblionumber);
31
            my $marc   = $biblio->metadata->record({ embed_items => 1 });
31
            my $marc   = $biblio->metadata_record({ embed_items => 1 });
32
32
33
            if( C4::Context->preference('DefaultSaveRecordFileID') eq 'controlnumber' ){
33
            if( C4::Context->preference('DefaultSaveRecordFileID') eq 'controlnumber' ){
34
                my $marcflavour = C4::Context->preference('marcflavour'); #FIXME This option is required but does not change control num behaviour
34
                my $marcflavour = C4::Context->preference('marcflavour'); #FIXME This option is required but does not change control num behaviour
(-)a/misc/batchRebuildItemsTables.pl (-1 / +1 lines)
Lines 74-80 while ( my ( $biblionumber, $biblioitemnumber, $frameworkcode ) = $sth->fetchrow Link Here
74
    $count++;
74
    $count++;
75
    warn $count unless $count % 1000;
75
    warn $count unless $count % 1000;
76
    my $biblio = Koha::Biblios->find($biblionumber);
76
    my $biblio = Koha::Biblios->find($biblionumber);
77
    my $record = $biblio->metadata->record({ embed_items => 1 });
77
    my $record = $biblio->metadata_record({ embed_items => 1 });
78
78
79
    unless ($record) { push @errors, "bad record biblionumber $biblionumber"; next; }
79
    unless ($record) { push @errors, "bad record biblionumber $biblionumber"; next; }
80
80
(-)a/misc/migration_tools/rebuild_zebra.pl (-1 / +1 lines)
Lines 683-689 sub get_raw_marc_record { Link Here
683
    if ($record_type eq 'biblio') {
683
    if ($record_type eq 'biblio') {
684
        eval {
684
        eval {
685
            my $biblio = Koha::Biblios->find($record_number);
685
            my $biblio = Koha::Biblios->find($record_number);
686
            $marc = $biblio->metadata->record({ embed_items => 1 });
686
            $marc = $biblio->metadata_record({ embed_items => 1 });
687
        };
687
        };
688
        if ($@ || !$marc) {
688
        if ($@ || !$marc) {
689
            # here we do warn since catching an exception
689
            # here we do warn since catching an exception
(-)a/opac/opac-MARCdetail.pl (-1 / +1 lines)
Lines 95-101 my $biblio = Koha::Biblios->find($biblionumber); Link Here
95
my $record = $biblio->metadata_record(
95
my $record = $biblio->metadata_record(
96
    {
96
    {
97
        embed_items => 1,
97
        embed_items => 1,
98
        opac        => 1,
98
        interface   => 'opac',
99
        patron      => $patron,
99
        patron      => $patron,
100
    }
100
    }
101
);
101
);
(-)a/opac/opac-downloadcart.pl (-2 / +2 lines)
Lines 77-86 if ($bib_list && $format) { Link Here
77
        foreach my $biblionumber (@bibs) {
77
        foreach my $biblionumber (@bibs) {
78
78
79
            my $biblio = Koha::Biblios->find($biblionumber);
79
            my $biblio = Koha::Biblios->find($biblionumber);
80
            my $record = $biblio->metadata->record(
80
            my $record = $biblio->metadata_record(
81
                {
81
                {
82
                    embed_items => 1,
82
                    embed_items => 1,
83
                    opac        => 1,
83
                    interface   => 'opac',
84
                    patron      => $patron,
84
                    patron      => $patron,
85
                }
85
                }
86
            );
86
            );
(-)a/opac/opac-downloadshelf.pl (-2 / +2 lines)
Lines 90-99 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
90
                my $biblionumber = $content->biblionumber;
90
                my $biblionumber = $content->biblionumber;
91
91
92
                my $biblio = Koha::Biblios->find($biblionumber);
92
                my $biblio = Koha::Biblios->find($biblionumber);
93
                my $record = $biblio->metadata->record->(
93
                my $record = $biblio->metadata_record(
94
                    {
94
                    {
95
                        embed_items => 1,
95
                        embed_items => 1,
96
                        opac        => 1,
96
                        interface   => 'opac',
97
                        patron      => $patron,
97
                        patron      => $patron,
98
                    }
98
                    }
99
                );
99
                );
(-)a/opac/opac-export.pl (-2 / +2 lines)
Lines 54-63 if ($userenv) { Link Here
54
my $include_items = ($format =~ /bibtex/) ? 0 : 1;
54
my $include_items = ($format =~ /bibtex/) ? 0 : 1;
55
my $biblio = Koha::Biblios->find($biblionumber);
55
my $biblio = Koha::Biblios->find($biblionumber);
56
my $marc = $biblio
56
my $marc = $biblio
57
  ? $biblio->metadata->record(
57
  ? $biblio->metadata_record(
58
    {
58
    {
59
        embed_items => 1,
59
        embed_items => 1,
60
        opac        => 1,
60
        interface   => 'opac',
61
        patron      => $patron,
61
        patron      => $patron,
62
    }
62
    }
63
  )
63
  )
(-)a/opac/opac-sendbasket.pl (-2 / +2 lines)
Lines 75-84 if ( $email_add ) { Link Here
75
75
76
        my $biblio           = Koha::Biblios->find( $biblionumber ) or next;
76
        my $biblio           = Koha::Biblios->find( $biblionumber ) or next;
77
        my $dat              = $biblio->unblessed;
77
        my $dat              = $biblio->unblessed;
78
        my $record = $biblio->metadata->record(
78
        my $record = $biblio->metadata_record(
79
            {
79
            {
80
                embed_items => 1,
80
                embed_items => 1,
81
                opac        => 1,
81
                interface   => 'opac',
82
                patron      => $patron,
82
                patron      => $patron,
83
            }
83
            }
84
        );
84
        );
(-)a/opac/opac-sendshelf.pl (-2 / +2 lines)
Lines 81-90 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
81
        my $biblionumber = $content->biblionumber;
81
        my $biblionumber = $content->biblionumber;
82
        my $biblio       = Koha::Biblios->find( $biblionumber ) or next;
82
        my $biblio       = Koha::Biblios->find( $biblionumber ) or next;
83
        my $dat          = $biblio->unblessed;
83
        my $dat          = $biblio->unblessed;
84
        my $record = $biblio->metadata->record(
84
        my $record = $biblio->metadata_record(
85
            {
85
            {
86
                embed_items => 1,
86
                embed_items => 1,
87
                opac        => 1,
87
                iinterface  => 'opac',
88
                patron      => $patron,
88
                patron      => $patron,
89
            }
89
            }
90
        );
90
        );
(-)a/opac/opac-tags.pl (-2 / +2 lines)
Lines 250-259 if ($loggedinuser) { Link Here
250
    foreach my $tag (@$my_tags) {
250
    foreach my $tag (@$my_tags) {
251
        $tag->{visible} = 0;
251
        $tag->{visible} = 0;
252
        my $biblio = Koha::Biblios->find( $tag->{biblionumber} );
252
        my $biblio = Koha::Biblios->find( $tag->{biblionumber} );
253
        my $record = $biblio->metadata->record(
253
        my $record = $biblio->metadata_record(
254
            {
254
            {
255
                embed_items => 1,
255
                embed_items => 1,
256
                opac        => 1,
256
                interface   => 'opac',
257
                patron      => $patron,
257
                patron      => $patron,
258
            }
258
            }
259
        );
259
        );
(-)a/opac/opac-user.pl (-1 / +7 lines)
Lines 283-289 if ( $pending_checkouts->count ) { # Useless test Link Here
283
283
284
        my $isbn = GetNormalizedISBN($issue->{'isbn'});
284
        my $isbn = GetNormalizedISBN($issue->{'isbn'});
285
        $issue->{normalized_isbn} = $isbn;
285
        $issue->{normalized_isbn} = $isbn;
286
        my $marcrecord = $biblio_object->metadata->record({ embed_items => 1, opac => 1, patron => $patron,});
286
        my $marcrecord = $biblio_object->metadata_record(
287
            {
288
                embed_items => 1,
289
                interface   => 'opac',
290
                patron      => $patron
291
            }
292
        );
287
        $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') );
293
        $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') );
288
294
289
                # My Summary HTML
295
                # My Summary HTML
(-)a/serials/subscription-add.pl (-2 / +2 lines)
Lines 365-371 sub redirect_add_subscription { Link Here
365
365
366
    my @additional_fields;
366
    my @additional_fields;
367
    my $biblio = Koha::Biblios->find($biblionumber);
367
    my $biblio = Koha::Biblios->find($biblionumber);
368
    my $record = $biblio->metadata->record({ embed_items => 1 });
368
    my $record = $biblio->metadata_record({ embed_items => 1 });
369
    my $subscription_fields = Koha::AdditionalFields->search({ tablename => 'subscription' });
369
    my $subscription_fields = Koha::AdditionalFields->search({ tablename => 'subscription' });
370
    while ( my $field = $subscription_fields->next ) {
370
    while ( my $field = $subscription_fields->next ) {
371
        my $value = $query->param('additional_field_' . $field->id);
371
        my $value = $query->param('additional_field_' . $field->id);
Lines 485-491 sub redirect_mod_subscription { Link Here
485
485
486
    my @additional_fields;
486
    my @additional_fields;
487
    my $biblio = Koha::Biblios->find($biblionumber);
487
    my $biblio = Koha::Biblios->find($biblionumber);
488
    my $record = $biblio->metadata->record({ embed_items => 1 });
488
    my $record = $biblio->metadata_record({ embed_items => 1 });
489
    my $subscription_fields = Koha::AdditionalFields->search({ tablename => 'subscription' });
489
    my $subscription_fields = Koha::AdditionalFields->search({ tablename => 'subscription' });
490
    while ( my $field = $subscription_fields->next ) {
490
    while ( my $field = $subscription_fields->next ) {
491
        my $value = $query->param('additional_field_' . $field->id);
491
        my $value = $query->param('additional_field_' . $field->id);
(-)a/svc/bib (-2 / +2 lines)
Lines 67-73 sub fetch_bib { Link Here
67
    my $query = shift;
67
    my $query = shift;
68
    my $biblionumber = shift;
68
    my $biblionumber = shift;
69
    my $biblio = Koha::Biblios->find( $biblionumber );
69
    my $biblio = Koha::Biblios->find( $biblionumber );
70
    my $record = $biblio->metadata->record({ embed_items => scalar $query->param('items') });
70
    my $record = $biblio->metadata_record({ embed_items => scalar $query->param('items') });
71
    if  (defined $record) {
71
    if  (defined $record) {
72
        print $query->header(-type => 'text/xml',-charset => 'utf-8',);
72
        print $query->header(-type => 'text/xml',-charset => 'utf-8',);
73
        print $record->as_xml_record();
73
        print $record->as_xml_record();
Lines 117-123 sub update_bib { Link Here
117
117
118
        C4::Biblio::ModBiblio( $record, $biblionumber, $frameworkcode );
118
        C4::Biblio::ModBiblio( $record, $biblionumber, $frameworkcode );
119
        my $biblio = Koha::Biblios->find( $biblionumber );
119
        my $biblio = Koha::Biblios->find( $biblionumber );
120
        my $new_record = $biblio->metadata->record({ embed_items => scalar $query->url_param('items') });
120
        my $new_record = $biblio->metadata_record({ embed_items => scalar $query->url_param('items') });
121
121
122
        $result->{'status'} = "ok";
122
        $result->{'status'} = "ok";
123
        $result->{'biblionumber'} = $biblionumber;
123
        $result->{'biblionumber'} = $biblionumber;
(-)a/svc/new_bib (-1 / +1 lines)
Lines 88-94 sub add_bib { Link Here
88
        }
88
        }
89
89
90
        $biblio = Koha::Biblios->find( $biblionumber );
90
        $biblio = Koha::Biblios->find( $biblionumber );
91
        $new_record = $biblio->metadata->record({ embed_items => scalar $query->url_param('items') });
91
        $new_record = $biblio->metadata_record({ embed_items => scalar $query->url_param('items') });
92
        $result->{'status'} = "ok";
92
        $result->{'status'} = "ok";
93
        $result->{'biblionumber'} = $biblionumber;
93
        $result->{'biblionumber'} = $biblionumber;
94
        my $xml = $new_record->as_xml_record();
94
        my $xml = $new_record->as_xml_record();
(-)a/tools/showdiffmarc.pl (-1 / +1 lines)
Lines 62-68 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
62
62
63
if ( $type eq 'biblio' ) {
63
if ( $type eq 'biblio' ) {
64
    my $biblio = Koha::Biblios->find( $recordid );
64
    my $biblio = Koha::Biblios->find( $recordid );
65
    $record = $biblio->metadata->record({ embed_items => 1 });
65
    $record = $biblio->metadata_record({ embed_items => 1 });
66
    $recordTitle = $biblio->title;
66
    $recordTitle = $biblio->title;
67
}
67
}
68
elsif ( $type eq 'auth' ) {
68
elsif ( $type eq 'auth' ) {
(-)a/virtualshelves/downloadshelf.pl (-1 / +1 lines)
Lines 69-75 if ($shelfid && $format) { Link Here
69
                while ( my $content = $contents->next ) {
69
                while ( my $content = $contents->next ) {
70
                    my $biblionumber = $content->biblionumber;
70
                    my $biblionumber = $content->biblionumber;
71
                    my $biblio = Koha::Biblios->find($biblionumber);
71
                    my $biblio = Koha::Biblios->find($biblionumber);
72
                    my $record = $biblio->metadata->record({ embed_items => 1 });
72
                    my $record = $biblio->metadata_record({ embed_items => 1 });
73
                    if ($format eq 'iso2709') {
73
                    if ($format eq 'iso2709') {
74
                        $output .= $record->as_usmarc();
74
                        $output .= $record->as_usmarc();
75
                    }
75
                    }
(-)a/virtualshelves/sendshelf.pl (-2 / +1 lines)
Lines 78-84 if ($to_address) { Link Here
78
        my $biblionumber     = $content->biblionumber;
78
        my $biblionumber     = $content->biblionumber;
79
        my $biblio           = Koha::Biblios->find( $biblionumber ) or next;
79
        my $biblio           = Koha::Biblios->find( $biblionumber ) or next;
80
        my $dat              = $biblio->unblessed;
80
        my $dat              = $biblio->unblessed;
81
        my $record           = $biblio->metadata->record({ embed_items => 1 });
81
        my $record           = $biblio->metadata_record({ embed_items => 1 });
82
        my $marcauthorsarray = $biblio->get_marc_contributors;
82
        my $marcauthorsarray = $biblio->get_marc_contributors;
83
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
83
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
84
84
85
- 

Return to bug 31224