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

(-)a/C4/AuthoritiesMarc.pm (-1 / +1 lines)
Lines 1475-1481 sub merge { Link Here
1475
1475
1476
    my $counteditedbiblio = 0;
1476
    my $counteditedbiblio = 0;
1477
    foreach my $biblionumber ( @biblionumbers ) {
1477
    foreach my $biblionumber ( @biblionumbers ) {
1478
        my $marcrecord = GetMarcBiblio( $biblionumber );
1478
        my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
1479
        next if !$marcrecord;
1479
        next if !$marcrecord;
1480
        my $update = 0;
1480
        my $update = 0;
1481
        foreach my $tagfield (@$tags_using_authtype) {
1481
        foreach my $tagfield (@$tags_using_authtype) {
(-)a/C4/Biblio.pm (-9 / +25 lines)
Lines 293-299 sub ModBiblio { Link Here
293
    }
293
    }
294
294
295
    if ( C4::Context->preference("CataloguingLog") ) {
295
    if ( C4::Context->preference("CataloguingLog") ) {
296
        my $newrecord = GetMarcBiblio($biblionumber);
296
        my $newrecord = GetMarcBiblio({ biblionumber => $biblionumber });
297
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $newrecord->as_formatted );
297
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $newrecord->as_formatted );
298
    }
298
    }
299
299
Lines 1136-1146 sub GetMarcSubfieldStructureFromKohaField { Link Here
1136
1136
1137
=head2 GetMarcBiblio
1137
=head2 GetMarcBiblio
1138
1138
1139
  my $record = GetMarcBiblio($biblionumber, [$embeditems], [$opac]);
1139
  my $record = GetMarcBiblio({
1140
      biblionumber => $biblionumber,
1141
      embed_items  => $embeditems,
1142
      opac         => $opac });
1140
1143
1141
Returns MARC::Record representing a biblio record, or C<undef> if the
1144
Returns MARC::Record representing a biblio record, or C<undef> if the
1142
biblionumber doesn't exist.
1145
biblionumber doesn't exist.
1143
1146
1147
Both embed_items and opac are optional.
1148
If embed_items is passed and is 1, items are embedded.
1149
If opac is passed and is 1, the record is filtered as needed.
1150
1144
=over 4
1151
=over 4
1145
1152
1146
=item C<$biblionumber>
1153
=item C<$biblionumber>
Lines 1161-1169 OpacHiddenItems to be applied. Link Here
1161
=cut
1168
=cut
1162
1169
1163
sub GetMarcBiblio {
1170
sub GetMarcBiblio {
1164
    my $biblionumber = shift;
1171
    my ($params) = @_;
1165
    my $embeditems   = shift || 0;
1172
1166
    my $opac         = shift || 0;
1173
    if (not defined $params) {
1174
        carp 'GetMarcBiblio called without parameters';
1175
        return;
1176
    }
1177
1178
    my $biblionumber = $params->{biblionumber};
1179
    my $embeditems   = $params->{embed_items} || 0;
1180
    my $opac         = $params->{opac} || 0;
1167
1181
1168
    if (not defined $biblionumber) {
1182
    if (not defined $biblionumber) {
1169
        carp 'GetMarcBiblio called with undefined biblionumber';
1183
        carp 'GetMarcBiblio called with undefined biblionumber';
Lines 2181-2187 sub PrepHostMarcField { Link Here
2181
    $marcflavour ||="MARC21";
2195
    $marcflavour ||="MARC21";
2182
    
2196
    
2183
    require C4::Items;
2197
    require C4::Items;
2184
    my $hostrecord = GetMarcBiblio($hostbiblionumber);
2198
    my $hostrecord = GetMarcBiblio({ biblionumber => $hostbiblionumber });
2185
	my $item = C4::Items::GetItem($hostitemnumber);
2199
	my $item = C4::Items::GetItem($hostitemnumber);
2186
	
2200
	
2187
	my $hostmarcfield;
2201
	my $hostmarcfield;
Lines 2830-2836 sub ModZebra { Link Here
2830
        );
2844
        );
2831
        if ( $op eq 'specialUpdate' ) {
2845
        if ( $op eq 'specialUpdate' ) {
2832
            unless ($record) {
2846
            unless ($record) {
2833
                $record = GetMarcBiblio($biblionumber, 1);
2847
                $record = GetMarcBiblio({
2848
                    biblionumber => $biblionumber,
2849
                    embed_items  => 1 });
2834
            }
2850
            }
2835
            my $records = [$record];
2851
            my $records = [$record];
2836
            $indexer->update_index_background( [$biblionumber], [$record] );
2852
            $indexer->update_index_background( [$biblionumber], [$record] );
Lines 3443-3449 Generate the host item entry for an analytic child entry Link Here
3443
sub prepare_host_field {
3459
sub prepare_host_field {
3444
    my ( $hostbiblio, $marcflavour ) = @_;
3460
    my ( $hostbiblio, $marcflavour ) = @_;
3445
    $marcflavour ||= C4::Context->preference('marcflavour');
3461
    $marcflavour ||= C4::Context->preference('marcflavour');
3446
    my $host = GetMarcBiblio($hostbiblio);
3462
    my $host = GetMarcBiblio({ biblionumber => $hostbiblio });
3447
    # unfortunately as_string does not 'do the right thing'
3463
    # unfortunately as_string does not 'do the right thing'
3448
    # if field returns undef
3464
    # if field returns undef
3449
    my %sfd;
3465
    my %sfd;
Lines 3581-3587 sub UpdateTotalIssues { Link Here
3581
    my ($biblionumber, $increase, $value) = @_;
3597
    my ($biblionumber, $increase, $value) = @_;
3582
    my $totalissues;
3598
    my $totalissues;
3583
3599
3584
    my $record = GetMarcBiblio($biblionumber);
3600
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
3585
    unless ($record) {
3601
    unless ($record) {
3586
        carp "UpdateTotalIssues could not get biblio record";
3602
        carp "UpdateTotalIssues could not get biblio record";
3587
        return;
3603
        return;
(-)a/C4/HoldsQueue.pm (-1 / +1 lines)
Lines 146-152 sub GetHoldsQueueItems { Link Here
146
    $sth->execute(@bind_params);
146
    $sth->execute(@bind_params);
147
    my $items = [];
147
    my $items = [];
148
    while ( my $row = $sth->fetchrow_hashref ){
148
    while ( my $row = $sth->fetchrow_hashref ){
149
        my $record = GetMarcBiblio($row->{biblionumber});
149
        my $record = GetMarcBiblio({ biblionumber => $row->{biblionumber} });
150
        if ($record){
150
        if ($record){
151
            $row->{subtitle} = [ map { $_->{subfield} } @{ GetRecordValue( 'subtitle', $record, '' ) } ];
151
            $row->{subtitle} = [ map { $_->{subfield} } @{ GetRecordValue( 'subtitle', $record, '' ) } ];
152
            $row->{parts} = GetRecordValue('parts',$record,'')->[0]->{subfield};
152
            $row->{parts} = GetRecordValue('parts',$record,'')->[0]->{subfield};
(-)a/C4/ILSDI/Services.pm (-1 / +3 lines)
Lines 214-220 sub GetRecords { Link Here
214
        }
214
        }
215
215
216
        my $embed_items = 1;
216
        my $embed_items = 1;
217
        my $record = GetMarcBiblio($biblionumber, $embed_items);
217
        my $record = GetMarcBiblio({
218
            biblionumber => $biblionumber,
219
            embed_items  => $embed_items });
218
        if ($record) {
220
        if ($record) {
219
            $biblioitem->{marcxml} = $record->as_xml_record();
221
            $biblioitem->{marcxml} = $record->as_xml_record();
220
        }
222
        }
(-)a/C4/Items.pm (-1 / +1 lines)
Lines 1321-1327 references on array of itemnumbers. Link Here
1321
1321
1322
sub get_hostitemnumbers_of {
1322
sub get_hostitemnumbers_of {
1323
    my ($biblionumber) = @_;
1323
    my ($biblionumber) = @_;
1324
    my $marcrecord = GetMarcBiblio($biblionumber);
1324
    my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
1325
1325
1326
    return unless $marcrecord;
1326
    return unless $marcrecord;
1327
1327
(-)a/C4/Labels/Label.pm (-2 / +2 lines)
Lines 396-402 sub draw_label_text { Link Here
396
    my $font = $self->{'font'};
396
    my $font = $self->{'font'};
397
    my $item = _get_label_item($self->{'item_number'});
397
    my $item = _get_label_item($self->{'item_number'});
398
    my $label_fields = _get_text_fields($self->{'format_string'});
398
    my $label_fields = _get_text_fields($self->{'format_string'});
399
    my $record = GetMarcBiblio($item->{'biblionumber'});
399
    my $record = GetMarcBiblio({ biblionumber => $item->{'biblionumber'} });
400
    # FIXME - returns all items, so you can't get data from an embedded holdings field.
400
    # FIXME - returns all items, so you can't get data from an embedded holdings field.
401
    # TODO - add a GetMarcBiblio1item(bibnum,itemnum) or a GetMarcItem(itemnum).
401
    # TODO - add a GetMarcBiblio1item(bibnum,itemnum) or a GetMarcItem(itemnum).
402
    my $cn_source = ($item->{'cn_source'} ? $item->{'cn_source'} : C4::Context->preference('DefaultClassificationSource'));
402
    my $cn_source = ($item->{'cn_source'} ? $item->{'cn_source'} : C4::Context->preference('DefaultClassificationSource'));
Lines 601-607 sub csv_data { Link Here
601
    my $self = shift;
601
    my $self = shift;
602
    my $label_fields = _get_text_fields($self->{'format_string'});
602
    my $label_fields = _get_text_fields($self->{'format_string'});
603
    my $item = _get_label_item($self->{'item_number'});
603
    my $item = _get_label_item($self->{'item_number'});
604
    my $bib_record = GetMarcBiblio($item->{biblionumber});
604
    my $bib_record = GetMarcBiblio({ biblionumber => $item->{biblionumber} });
605
    my @csv_data = (map { _get_barcode_data($_->{'code'},$item,$bib_record) } @$label_fields);
605
    my @csv_data = (map { _get_barcode_data($_->{'code'},$item,$bib_record) } @$label_fields);
606
    return \@csv_data;
606
    return \@csv_data;
607
}
607
}
(-)a/C4/Record.pm (-1 / +1 lines)
Lines 471-477 sub marcrecord2csv { Link Here
471
    my $output;
471
    my $output;
472
472
473
    # Getting the record
473
    # Getting the record
474
    my $record = GetMarcBiblio($biblio);
474
    my $record = GetMarcBiblio({ biblionumber => $biblio });
475
    return unless $record;
475
    return unless $record;
476
    C4::Biblio::EmbedItemsInMarcBiblio( $record, $biblio, $itemnumbers );
476
    C4::Biblio::EmbedItemsInMarcBiblio( $record, $biblio, $itemnumbers );
477
    # Getting the framework
477
    # Getting the framework
(-)a/C4/Search.pm (-1 / +3 lines)
Lines 2008-2014 sub searchResults { Link Here
2008
            my $hostbiblionumber = $hostfield->subfield("0");
2008
            my $hostbiblionumber = $hostfield->subfield("0");
2009
            my $linkeditemnumber = $hostfield->subfield("9");
2009
            my $linkeditemnumber = $hostfield->subfield("9");
2010
            if(!$hostbiblionumber eq undef){
2010
            if(!$hostbiblionumber eq undef){
2011
                my $hostbiblio = GetMarcBiblio($hostbiblionumber, 1);
2011
                my $hostbiblio = GetMarcBiblio({
2012
                    biblionumber => $hostbiblionumber,
2013
                    embed_items  => 1 });
2012
                my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
2014
                my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
2013
                if(!$hostbiblio eq undef){
2015
                if(!$hostbiblio eq undef){
2014
                    my @hostitems = $hostbiblio->field($itemfield);
2016
                    my @hostitems = $hostbiblio->field($itemfield);
(-)a/C4/Serials.pm (-1 / +1 lines)
Lines 1485-1491 sub NewSubscription { Link Here
1485
    #set serial flag on biblio if not already set.
1485
    #set serial flag on biblio if not already set.
1486
    my $biblio = Koha::Biblios->find( $biblionumber );
1486
    my $biblio = Koha::Biblios->find( $biblionumber );
1487
    if ( $biblio and !$biblio->serial ) {
1487
    if ( $biblio and !$biblio->serial ) {
1488
        my $record = GetMarcBiblio($biblionumber);
1488
        my $record = GetMarcBiblio({ biblionumber => $biblionumber });
1489
        my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial', $biblio->frameworkcode );
1489
        my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial', $biblio->frameworkcode );
1490
        if ($tag) {
1490
        if ($tag) {
1491
            eval { $record->field($tag)->update( $subf => 1 ); };
1491
            eval { $record->field($tag)->update( $subf => 1 ); };
(-)a/C4/ShelfBrowser.pm (-1 / +1 lines)
Lines 223-229 sub GetShelfInfo { Link Here
223
        my $this_biblio = GetBibData($item->{biblionumber});
223
        my $this_biblio = GetBibData($item->{biblionumber});
224
        next unless defined $this_biblio;
224
        next unless defined $this_biblio;
225
        $item->{'title'} = $this_biblio->{'title'};
225
        $item->{'title'} = $this_biblio->{'title'};
226
        my $this_record = GetMarcBiblio($this_biblio->{'biblionumber'});
226
        my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} });
227
        $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
227
        $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
228
        $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
228
        $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
229
        $item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
229
        $item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
(-)a/Koha/Biblio.pm (-1 / +5 lines)
Lines 58-64 Keyword to MARC mapping for subtitle must be set for this method to return any p Link Here
58
sub subtitles {
58
sub subtitles {
59
    my ( $self ) = @_;
59
    my ( $self ) = @_;
60
60
61
    return map { $_->{subfield} } @{ C4::Biblio::GetRecordValue( 'subtitle', C4::Biblio::GetMarcBiblio( $self->id ), $self->frameworkcode ) };
61
    return map { $_->{subfield} } @{
62
        C4::Biblio::GetRecordValue(
63
            'subtitle',
64
            C4::Biblio::GetMarcBiblio({ biblionumber => $self->id }),
65
            $self->frameworkcode ) };
62
}
66
}
63
67
64
=head3 can_article_request
68
=head3 can_article_request
(-)a/Koha/BiblioUtils.pm (-2 / +6 lines)
Lines 121-127 sub get_all_biblios_iterator { Link Here
121
        while (1) {
121
        while (1) {
122
            my $row = $rs->next();
122
            my $row = $rs->next();
123
            return if !$row;
123
            return if !$row;
124
            my $marc = C4::Biblio::GetMarcBiblio( $row->biblionumber, 1 );
124
            my $marc = C4::Biblio::GetMarcBiblio({
125
                biblionumber => $row->biblionumber,
126
                embed_items  => 1 });
125
            my $next = eval {
127
            my $next = eval {
126
                __PACKAGE__->new($marc, $row->biblionumber);
128
                __PACKAGE__->new($marc, $row->biblionumber);
127
            };
129
            };
Lines 158-164 If set to true, item data is embedded in the record. Default is to not do this. Link Here
158
sub get_marc_biblio {
160
sub get_marc_biblio {
159
    my ($class, $bibnum, %options) = @_;
161
    my ($class, $bibnum, %options) = @_;
160
162
161
    return C4::Biblio::GetMarcBiblio( $bibnum, ($options{item_data} ? 1 : 0 ) );
163
    return C4::Biblio::GetMarcBiblio({
164
        biblionumber => $bibnum,
165
        embed_items  => ($options{item_data} ? 1 : 0 ) });
162
}
166
}
163
167
164
1;
168
1;
(-)a/Koha/Exporter/Record.pm (-1 / +1 lines)
Lines 65-71 sub _get_biblio_for_export { Link Here
65
    my $export_items = $params->{export_items} // 1;
65
    my $export_items = $params->{export_items} // 1;
66
    my $only_export_items_for_branch = $params->{only_export_items_for_branch};
66
    my $only_export_items_for_branch = $params->{only_export_items_for_branch};
67
67
68
    my $record = eval { C4::Biblio::GetMarcBiblio($biblionumber); };
68
    my $record = eval { C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); };
69
69
70
    return if $@ or not defined $record;
70
    return if $@ or not defined $record;
71
71
(-)a/Koha/OAI/Server/Repository.pm (-1 / +4 lines)
Lines 160-166 sub get_biblio_marcxml { Link Here
160
    if ( my $conf = $self->{conf} ) {
160
    if ( my $conf = $self->{conf} ) {
161
        $with_items = $conf->{format}->{$format}->{include_items};
161
        $with_items = $conf->{format}->{$format}->{include_items};
162
    }
162
    }
163
    my $record = GetMarcBiblio($biblionumber, $with_items, 1);
163
    my $record = GetMarcBiblio({
164
        biblionumber => $biblionumber,
165
        embed_items  => $with_items,
166
        opac         => 1 });
164
    $record ? $record->as_xml_record() : undef;
167
    $record ? $record->as_xml_record() : undef;
165
}
168
}
166
169
(-)a/basket/basket.pl (-1 / +1 lines)
Lines 65-71 foreach my $biblionumber ( @bibs ) { Link Here
65
65
66
    my $dat              = &GetBiblioData($biblionumber);
66
    my $dat              = &GetBiblioData($biblionumber);
67
    next unless $dat;
67
    next unless $dat;
68
    my $record           = &GetMarcBiblio($biblionumber);
68
    my $record           = &GetMarcBiblio({ biblionumber => $biblionumber });
69
    $dat->{subtitle}     = GetRecordValue('subtitle', $record, $fw);
69
    $dat->{subtitle}     = GetRecordValue('subtitle', $record, $fw);
70
    my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
70
    my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
71
    my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
71
    my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
(-)a/basket/downloadcart.pl (-1 / +3 lines)
Lines 65-71 if ($bib_list && $format) { Link Here
65
65
66
        foreach my $biblio (@bibs) {
66
        foreach my $biblio (@bibs) {
67
67
68
            my $record = GetMarcBiblio($biblio, 1);
68
            my $record = GetMarcBiblio({
69
                biblionumber => $biblio,
70
                embed_items  => 1 });
69
            next unless $record;
71
            next unless $record;
70
72
71
            if ($format eq 'iso2709') {
73
            if ($format eq 'iso2709') {
(-)a/basket/sendbasket.pl (-1 / +3 lines)
Lines 73-79 if ( $email_add ) { Link Here
73
73
74
        my $dat              = GetBiblioData($biblionumber);
74
        my $dat              = GetBiblioData($biblionumber);
75
        next unless $dat;
75
        next unless $dat;
76
        my $record           = GetMarcBiblio($biblionumber, 1);
76
        my $record           = GetMarcBiblio({
77
            biblionumber => $biblionumber,
78
            embed_items => 1 });
77
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
79
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
78
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
80
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
79
81
(-)a/catalogue/ISBDdetail.pl (-1 / +3 lines)
Lines 78-84 if ( not defined $biblionumber ) { Link Here
78
       exit;
78
       exit;
79
}
79
}
80
80
81
my $record = GetMarcBiblio($biblionumber,1);
81
my $record = GetMarcBiblio({
82
    biblionumber => $biblionumber,
83
    embed_items  => 1 });
82
84
83
if ( not defined $record ) {
85
if ( not defined $record ) {
84
       # biblionumber invalid -> report and exit
86
       # biblionumber invalid -> report and exit
(-)a/catalogue/MARCdetail.pl (-1 / +3 lines)
Lines 88-94 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
88
    }
88
    }
89
);
89
);
90
90
91
my $record = GetMarcBiblio($biblionumber, 1);
91
my $record = GetMarcBiblio({
92
    biblionumber => $biblionumber,
93
    embed_items  => 1 });
92
$template->param( ocoins => GetCOinSBiblio($record) );
94
$template->param( ocoins => GetCOinSBiblio($record) );
93
95
94
if ( not defined $record ) {
96
if ( not defined $record ) {
(-)a/catalogue/detail.pl (-1 / +1 lines)
Lines 63-69 my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( Link Here
63
63
64
my $biblionumber = $query->param('biblionumber');
64
my $biblionumber = $query->param('biblionumber');
65
$biblionumber = HTML::Entities::encode($biblionumber);
65
$biblionumber = HTML::Entities::encode($biblionumber);
66
my $record       = GetMarcBiblio($biblionumber);
66
my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
67
67
68
if ( not defined $record ) {
68
if ( not defined $record ) {
69
    # biblionumber invalid -> report and exit
69
    # biblionumber invalid -> report and exit
(-)a/catalogue/export.pl (-1 / +3 lines)
Lines 28-34 if ($op eq "export") { Link Here
28
    my $biblionumber = $query->param("bib");
28
    my $biblionumber = $query->param("bib");
29
        if ($biblionumber){
29
        if ($biblionumber){
30
30
31
            my $marc = GetMarcBiblio($biblionumber, 1);
31
            my $marc = GetMarcBiblio({
32
                biblionumber => $biblionumber,
33
                embed_items  => 1 });
32
34
33
            if ($format =~ /endnote/) {
35
            if ($format =~ /endnote/) {
34
                $marc = marc2endnote($marc);
36
                $marc = marc2endnote($marc);
(-)a/catalogue/labeledMARCdetail.pl (-1 / +1 lines)
Lines 56-62 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
56
    }
56
    }
57
);
57
);
58
58
59
my $record = GetMarcBiblio($biblionumber);
59
my $record = GetMarcBiblio({ biblionumber => $biblionumber });
60
if ( not defined $record ) {
60
if ( not defined $record ) {
61
    # biblionumber invalid -> report and exit
61
    # biblionumber invalid -> report and exit
62
    $template->param( unknownbiblionumber => 1,
62
    $template->param( unknownbiblionumber => 1,
(-)a/catalogue/moredetail.pl (-1 / +1 lines)
Lines 100-106 for my $itm (@all_items) { Link Here
100
                               ($itemnumber != $itm->{itemnumber}));
100
                               ($itemnumber != $itm->{itemnumber}));
101
}
101
}
102
102
103
my $record=GetMarcBiblio($biblionumber);
103
my $record=GetMarcBiblio({ biblionumber => $biblionumber });
104
104
105
my $hostrecords;
105
my $hostrecords;
106
# adding items linked via host biblios
106
# adding items linked via host biblios
(-)a/catalogue/showmarc.pl (-1 / +1 lines)
Lines 46-52 if ($importid) { Link Here
46
    $record = C4::ImportBatch::GetRecordFromImportBiblio( $importid, 'embed_items' );
46
    $record = C4::ImportBatch::GetRecordFromImportBiblio( $importid, 'embed_items' );
47
}
47
}
48
else {
48
else {
49
    $record =GetMarcBiblio($biblionumber);
49
    $record =GetMarcBiblio({ biblionumber => $biblionumber });
50
}
50
}
51
if(!ref $record) {
51
if(!ref $record) {
52
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
52
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 770-776 my ( Link Here
770
);
770
);
771
771
772
if (($biblionumber) && !($breedingid)){
772
if (($biblionumber) && !($breedingid)){
773
	$record = GetMarcBiblio($biblionumber);
773
    $record = GetMarcBiblio({ biblionumber => $biblionumber });
774
}
774
}
775
if ($breedingid) {
775
if ($breedingid) {
776
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
776
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
(-)a/cataloguing/additem.pl (-3 / +5 lines)
Lines 411-417 $restrictededition = 0 if ($restrictededition != 0 && C4::Context->IsSuperLibra Link Here
411
$restrictededition = 0 if ($restrictededition != 0 && $frameworkcode eq 'FA' && haspermission($uid, {'editcatalogue' => 'fast_cataloging'}));
411
$restrictededition = 0 if ($restrictededition != 0 && $frameworkcode eq 'FA' && haspermission($uid, {'editcatalogue' => 'fast_cataloging'}));
412
412
413
my $tagslib = &GetMarcStructure(1,$frameworkcode);
413
my $tagslib = &GetMarcStructure(1,$frameworkcode);
414
my $record = GetMarcBiblio($biblionumber);
414
my $record = GetMarcBiblio({ biblionumber => $biblionumber });
415
my $oldrecord = TransformMarcToKoha($record);
415
my $oldrecord = TransformMarcToKoha($record);
416
my $itemrecord;
416
my $itemrecord;
417
my $nextop="additem";
417
my $nextop="additem";
Lines 724-730 if ($op eq "additem") { Link Here
724
#-------------------------------------------------------------------------------
724
#-------------------------------------------------------------------------------
725
725
726
# now, build existiing item list
726
# now, build existiing item list
727
my $temp = GetMarcBiblio( $biblionumber );
727
my $temp = GetMarcBiblio({ biblionumber => $biblionumber });
728
#my @fields = $record->fields();
728
#my @fields = $record->fields();
729
729
730
730
Lines 748-754 if ( C4::Context->preference('EasyAnalyticalRecords') ) { Link Here
748
    foreach my $hostfield ($temp->field($analyticfield)){
748
    foreach my $hostfield ($temp->field($analyticfield)){
749
        my $hostbiblionumber = $hostfield->subfield('0');
749
        my $hostbiblionumber = $hostfield->subfield('0');
750
        if ($hostbiblionumber){
750
        if ($hostbiblionumber){
751
            my $hostrecord = GetMarcBiblio($hostbiblionumber, 1);
751
            my $hostrecord = GetMarcBiblio({
752
                biblionumber => $hostbiblionumber,
753
                embed_items  => 1 });
752
            if ($hostrecord) {
754
            if ($hostrecord) {
753
                my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
755
                my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
754
                foreach my $hostitem ($hostrecord->field($itemfield)){
756
                foreach my $hostitem ($hostrecord->field($itemfield)){
(-)a/cataloguing/linkitem.pl (-1 / +1 lines)
Lines 45-51 my ($template, $loggedinuser, $cookie) = get_template_and_user( Link Here
45
    }
45
    }
46
);
46
);
47
47
48
my $biblio = GetMarcBiblio($biblionumber);
48
my $biblio = GetMarcBiblio({ biblionumber => $biblionumber });
49
my $marcflavour = C4::Context->preference("marcflavour");
49
my $marcflavour = C4::Context->preference("marcflavour");
50
$marcflavour ||="MARC21";
50
$marcflavour ||="MARC21";
51
if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC') {
51
if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC') {
(-)a/cataloguing/merge.pl (-3 / +3 lines)
Lines 78-84 if ($merge) { Link Here
78
    }
78
    }
79
79
80
    # Rewriting the leader
80
    # Rewriting the leader
81
    $record->leader(GetMarcBiblio($ref_biblionumber)->leader());
81
    $record->leader(GetMarcBiblio({ biblionumber => $ref_biblionumber })->leader());
82
82
83
    my $frameworkcode = $input->param('frameworkcode');
83
    my $frameworkcode = $input->param('frameworkcode');
84
    my @notmoveditems;
84
    my @notmoveditems;
Lines 115-121 if ($merge) { Link Here
115
    my $report_header = {};
115
    my $report_header = {};
116
    foreach my $biblionumber ($ref_biblionumber, @biblionumbers) {
116
    foreach my $biblionumber ($ref_biblionumber, @biblionumbers) {
117
        # build report
117
        # build report
118
        my $marcrecord = GetMarcBiblio($biblionumber);
118
        my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
119
        my %report_record = (
119
        my %report_record = (
120
            biblionumber => $biblionumber,
120
            biblionumber => $biblionumber,
121
            fields => {},
121
            fields => {},
Lines 202-208 if ($merge) { Link Here
202
        # Creating a loop for display
202
        # Creating a loop for display
203
        my @records;
203
        my @records;
204
        foreach my $biblionumber (@biblionumbers) {
204
        foreach my $biblionumber (@biblionumbers) {
205
            my $marcrecord = GetMarcBiblio($biblionumber);
205
            my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
206
            my $frameworkcode = GetFrameworkCode($biblionumber);
206
            my $frameworkcode = GetFrameworkCode($biblionumber);
207
            my $recordObj = new Koha::MetadataRecord({'record' => $marcrecord, schema => $marcflavour});
207
            my $recordObj = new Koha::MetadataRecord({'record' => $marcrecord, schema => $marcflavour});
208
            my $record = {
208
            my $record = {
(-)a/cataloguing/value_builder/marc21_linking_section.pl (-1 / +1 lines)
Lines 85-91 my $launcher = sub { Link Here
85
        );
85
        );
86
86
87
        #get marc record
87
        #get marc record
88
        $marcrecord = GetMarcBiblio($biblionumber);
88
        $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
89
89
90
        my $subfield_value_9 = $biblionumber;
90
        my $subfield_value_9 = $biblionumber;
91
        my $subfield_value_0 = $biblionumber;
91
        my $subfield_value_0 = $biblionumber;
(-)a/cataloguing/value_builder/unimarc_field_4XX.pl (-1 / +1 lines)
Lines 96-102 sub plugin { Link Here
96
        );
96
        );
97
97
98
        #get marc record
98
        #get marc record
99
        $marcrecord = GetMarcBiblio($biblionumber);
99
        $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
100
100
101
        my $subfield_value_9 = $biblionumber;
101
        my $subfield_value_9 = $biblionumber;
102
        my $subfield_value_0;
102
        my $subfield_value_0;
(-)a/circ/branchoverdues.pl (-1 / +1 lines)
Lines 110-116 if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { Link Here
110
# now display infos
110
# now display infos
111
foreach my $num (@getoverdues) {
111
foreach my $num (@getoverdues) {
112
    my %overdueforbranch;
112
    my %overdueforbranch;
113
    my $record = GetMarcBiblio($num->{biblionumber});
113
    my $record = GetMarcBiblio({ biblionumber => $num->{biblionumber} });
114
    if ($record){
114
    if ($record){
115
        $overdueforbranch{'subtitle'} = GetRecordValue('subtitle',$record,'')->[0]->{subfield};
115
        $overdueforbranch{'subtitle'} = GetRecordValue('subtitle',$record,'')->[0]->{subfield};
116
    }
116
    }
(-)a/circ/reserveratios.pl (-1 / +1 lines)
Lines 144-150 while ( my $data = $sth->fetchrow_hashref ) { Link Here
144
    my $thisratio = $data->{reservecount} / $data->{itemcount};
144
    my $thisratio = $data->{reservecount} / $data->{itemcount};
145
    my $ratiocalc = ($thisratio / $ratio);
145
    my $ratiocalc = ($thisratio / $ratio);
146
    ($thisratio / $ratio) >= 1 or next;  # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause
146
    ($thisratio / $ratio) >= 1 or next;  # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause
147
    my $record = GetMarcBiblio($data->{biblionumber});
147
    my $record = GetMarcBiblio({ biblionumber => $data->{biblionumber} });
148
    $data->{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($data->{biblionumber}));
148
    $data->{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($data->{biblionumber}));
149
    push(
149
    push(
150
        @reservedata,
150
        @reservedata,
(-)a/circ/transferstoreceive.pl (-1 / +1 lines)
Lines 109-115 while ( my $library = $libraries->next ) { Link Here
109
                itemcallnumber => $item->itemcallnumber,
109
                itemcallnumber => $item->itemcallnumber,
110
            );
110
            );
111
111
112
            my $record = GetMarcBiblio($biblio->biblionumber);
112
            my $record = GetMarcBiblio({ biblionumber => $biblio->biblionumber });
113
            $getransf{'subtitle'} = GetRecordValue('subtitle', $record, $biblio->frameworkcode);
113
            $getransf{'subtitle'} = GetRecordValue('subtitle', $record, $biblio->frameworkcode);
114
114
115
            # we check if we have a reserv for this transfer
115
            # we check if we have a reserv for this transfer
(-)a/circ/waitingreserves.pl (-1 / +4 lines)
Lines 113-119 foreach my $num (@getreserves) { Link Here
113
113
114
    $getreserv{'itemtype'}       = $itemtype->description; # FIXME Should not it be translated_description?
114
    $getreserv{'itemtype'}       = $itemtype->description; # FIXME Should not it be translated_description?
115
    $getreserv{'title'}          = $biblio->title;
115
    $getreserv{'title'}          = $biblio->title;
116
    $getreserv{'subtitle'}       = GetRecordValue('subtitle', GetMarcBiblio($biblio->biblionumber), $biblio->frameworkcode);
116
    $getreserv{'subtitle'}       = GetRecordValue(
117
        'subtitle',
118
        GetMarcBiblio({ biblionumber => $biblio->biblionumber }),
119
        $biblio->frameworkcode);
117
    $getreserv{'biblionumber'}   = $biblio->biblionumber;
120
    $getreserv{'biblionumber'}   = $biblio->biblionumber;
118
    $getreserv{'barcode'}        = $item->barcode;
121
    $getreserv{'barcode'}        = $item->barcode;
119
    $getreserv{'homebranch'}     = $homebranch;
122
    $getreserv{'homebranch'}     = $homebranch;
(-)a/misc/batchRebuildBiblioTables.pl (-1 / +1 lines)
Lines 61-67 $sth->execute; Link Here
61
my @errors;
61
my @errors;
62
while (my ($biblionumber)= $sth->fetchrow) {
62
while (my ($biblionumber)= $sth->fetchrow) {
63
    #now, parse the record, extract the item fields, and store them in somewhere else.
63
    #now, parse the record, extract the item fields, and store them in somewhere else.
64
    my $record = GetMarcBiblio($biblionumber);
64
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
65
    if (not defined $record) {
65
    if (not defined $record) {
66
	push @errors, $biblionumber;
66
	push @errors, $biblionumber;
67
	next;
67
	next;
(-)a/misc/batchRebuildItemsTables.pl (-1 / +3 lines)
Lines 68-74 $sth->execute(); Link Here
68
while ( my ( $biblionumber, $biblioitemnumber, $frameworkcode ) = $sth->fetchrow ) {
68
while ( my ( $biblionumber, $biblioitemnumber, $frameworkcode ) = $sth->fetchrow ) {
69
    $count++;
69
    $count++;
70
    warn $count unless $count % 1000;
70
    warn $count unless $count % 1000;
71
    my $record = GetMarcBiblio( $biblionumber, 1 );
71
    my $record = GetMarcBiblio({
72
        biblionummber => $biblionumber,
73
        embed_items   => 1 });
72
    unless ($record) { push @errors, "bad record biblionumber $biblionumber"; next; }
74
    unless ($record) { push @errors, "bad record biblionumber $biblionumber"; next; }
73
75
74
    unless ($test_parameter) {
76
    unless ($test_parameter) {
(-)a/misc/batchRepairMissingBiblionumbers.pl (-1 / +1 lines)
Lines 24-30 my $sth=$dbh->prepare("SELECT biblio.biblionumber, biblioitemnumber, frameworkco Link Here
24
$sth->execute();
24
$sth->execute();
25
25
26
while (my ($biblionumber,$biblioitemnumber,$frameworkcode)=$sth->fetchrow ){
26
while (my ($biblionumber,$biblioitemnumber,$frameworkcode)=$sth->fetchrow ){
27
    my $record = GetMarcBiblio($biblionumber);
27
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
28
    C4::Biblio::_koha_marc_update_bib_ids($record, $frameworkcode, $biblionumber, $biblioitemnumber);
28
    C4::Biblio::_koha_marc_update_bib_ids($record, $frameworkcode, $biblionumber, $biblioitemnumber);
29
    my $biblionumber = eval {ModBiblioMarc( $record, $biblionumber, $frameworkcode )};
29
    my $biblionumber = eval {ModBiblioMarc( $record, $biblionumber, $frameworkcode )};
30
    if($@){
30
    if($@){
(-)a/misc/cronjobs/build_browser_and_cloud.pl (-1 / +1 lines)
Lines 91-97 while ((my ($biblionumber)= $sth->fetchrow)) { Link Here
91
    #now, parse the record, extract the item fields, and store them in somewhere else.
91
    #now, parse the record, extract the item fields, and store them in somewhere else.
92
    my $Koharecord;
92
    my $Koharecord;
93
    eval{
93
    eval{
94
	    $Koharecord = GetMarcBiblio($biblionumber);
94
        $Koharecord = GetMarcBiblio({ biblionumber => $biblionumber });
95
    };
95
    };
96
    if($@){
96
    if($@){
97
	    warn 'pb when getting biblio '.$i.' : '.$@;
97
	    warn 'pb when getting biblio '.$i.' : '.$@;
(-)a/misc/cronjobs/check-url-quick.pl (-1 / +1 lines)
Lines 90-96 sub check_all_url { Link Here
90
        cb       => sub {
90
        cb       => sub {
91
            return if $count > $maxconn;
91
            return if $count > $maxconn;
92
            while ( my ($biblionumber) = $sth->fetchrow ) {
92
            while ( my ($biblionumber) = $sth->fetchrow ) {
93
                my $record = GetMarcBiblio($biblionumber);
93
                my $record = GetMarcBiblio({ biblionumber => $biblionumber });
94
                for my $tag (@tags) {
94
                for my $tag (@tags) {
95
                    foreach my $field ( $record->field($tag) ) {
95
                    foreach my $field ( $record->field($tag) ) {
96
                        my $url = $field->subfield('u');
96
                        my $url = $field->subfield('u');
(-)a/misc/cronjobs/check-url.pl (-1 / +1 lines)
Lines 105-111 sub check_biblio { Link Here
105
    my $host            = $self->{ host_default };
105
    my $host            = $self->{ host_default };
106
    my $bad_url         = $self->{ bad_url      };
106
    my $bad_url         = $self->{ bad_url      };
107
107
108
    my $record = GetMarcBiblio( $biblionumber ); 
108
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
109
    return unless $record->field('856');
109
    return unless $record->field('856');
110
110
111
    my @urls = ();
111
    my @urls = ();
(-)a/misc/link_bibs_to_authorities.pl (-1 / +1 lines)
Lines 187-193 sub process_bib { Link Here
187
    my $linker       = shift;
187
    my $linker       = shift;
188
    my $biblionumber = shift;
188
    my $biblionumber = shift;
189
189
190
    my $bib = GetMarcBiblio($biblionumber);
190
    my $bib = GetMarcBiblio({ biblionumber => $biblionumber });
191
    unless ( defined $bib ) {
191
    unless ( defined $bib ) {
192
        print
192
        print
193
"\nCould not retrieve bib $biblionumber from the database - record is corrupt.\n";
193
"\nCould not retrieve bib $biblionumber from the database - record is corrupt.\n";
(-)a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl (-1 / +1 lines)
Lines 87-93 my $sth_prepared; Link Here
87
87
88
sub updateMarc {
88
sub updateMarc {
89
    my $id     = shift;
89
    my $id     = shift;
90
    my $biblio = GetMarcBiblio($id);
90
    my $biblio = GetMarcBiblio({ biblionumber => $id });
91
91
92
    unless ($biblio) {
92
    unless ($biblio) {
93
        $debug and warn '[ERROR] GetMarcBiblio did not return any biblio.';
93
        $debug and warn '[ERROR] GetMarcBiblio did not return any biblio.';
(-)a/misc/maintenance/process_record_through_filter.pl (-1 / +1 lines)
Lines 10-16 use Koha::RecordProcessor; Link Here
10
use Data::Dumper;
10
use Data::Dumper;
11
use C4::Biblio;
11
use C4::Biblio;
12
12
13
my $record = GetMarcBiblio($ARGV[0]);
13
my $record = GetMarcBiblio({ biblionumber => $ARGV[0] });
14
14
15
print "Before: " . $record->as_formatted() . "\n";
15
print "Before: " . $record->as_formatted() . "\n";
16
my $processor = Koha::RecordProcessor->new( { filters => ( $ARGV[1] ) });
16
my $processor = Koha::RecordProcessor->new( { filters => ( $ARGV[1] ) });
(-)a/misc/maintenance/remove_items_from_biblioitems.pl (-1 / +1 lines)
Lines 49-55 while (my $biblionumber = $query->fetchrow){ Link Here
49
    $count++;
49
    $count++;
50
    print "." unless $silent;
50
    print "." unless $silent;
51
    print "\r$count" unless ($silent or ($count % 100)); 
51
    print "\r$count" unless ($silent or ($count % 100)); 
52
    my $record = GetMarcBiblio($biblionumber);
52
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
53
    
53
    
54
    if ($record) {
54
    if ($record) {
55
        ModBiblio($record, $biblionumber, GetFrameworkCode($biblionumber)) ;
55
        ModBiblio($record, $biblionumber, GetFrameworkCode($biblionumber)) ;
(-)a/misc/maintenance/sanitize_records.pl (-1 / +1 lines)
Lines 108-114 for my $biblionumber (@biblionumbers) { Link Here
108
        say " skipping. ERROR: Invalid biblionumber." if $verbose;
108
        say " skipping. ERROR: Invalid biblionumber." if $verbose;
109
        next;
109
        next;
110
    }
110
    }
111
    my $record = C4::Biblio::GetMarcBiblio($biblionumber);
111
    my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
112
    unless ($record) {
112
    unless ($record) {
113
        say " skipping. ERROR: Invalid record." if $verbose;
113
        say " skipping. ERROR: Invalid record." if $verbose;
114
        next;
114
        next;
(-)a/misc/maintenance/touch_all_biblios.pl (-1 / +1 lines)
Lines 78-84 $sth1->execute(); Link Here
78
78
79
# fetch info from the search
79
# fetch info from the search
80
while (my ($biblionumber, $frameworkcode) = $sth1->fetchrow_array){
80
while (my ($biblionumber, $frameworkcode) = $sth1->fetchrow_array){
81
  my $record = GetMarcBiblio($biblionumber);
81
  my $record = GetMarcBiblio({ biblionumber => $biblionumber });
82
 
82
 
83
  my $modok = ModBiblio($record, $biblionumber, $frameworkcode);
83
  my $modok = ModBiblio($record, $biblionumber, $frameworkcode);
84
84
(-)a/misc/migration_tools/buildEDITORS.pl (-5 / +5 lines)
Lines 70-76 my %alreadydone; Link Here
70
my $counter;
70
my $counter;
71
my %hash;
71
my %hash;
72
while (my ($bibid) = $sth->fetchrow) {
72
while (my ($bibid) = $sth->fetchrow) {
73
	my $record = GetMarcBiblio($bibid);
73
    my $record = GetMarcBiblio({ biblionumber => $bibid });
74
	my $isbnField = $record->field('010');
74
	my $isbnField = $record->field('010');
75
	next unless $isbnField;
75
	next unless $isbnField;
76
	my $isbn=$isbnField->subfield('a');
76
	my $isbn=$isbnField->subfield('a');
Lines 182-189 exit; Link Here
182
# 					# OK, on garde la notice d'autorit� on cherche les notices biblio et on les met �jour...
182
# 					# OK, on garde la notice d'autorit� on cherche les notices biblio et on les met �jour...
183
# 					if ($fieldnumber eq '710') {
183
# 					if ($fieldnumber eq '710') {
184
# 						$sthBIBLIOS710->execute($authentry);
184
# 						$sthBIBLIOS710->execute($authentry);
185
# 						while (my ($bibid,$tag,$tagorder,$subfieldorder) = $sthBIBLIOS710->fetchrow) {
185
#                        while (my ($bibid,$tag,$tagorder,$subfieldorder) = $sthBIBLIOS710->fetchrow) {
186
# 							my $inbiblio = GetMarcBiblio($bibid);
186
#                            my $inbiblio = GetMarcBiblio({ biblionumber => $bibid });
187
# 							my $isOK = 0;
187
# 							my $isOK = 0;
188
# 							foreach my $in7xx ($inbiblio->field($fieldnumber)) {
188
# 							foreach my $in7xx ($inbiblio->field($fieldnumber)) {
189
# 								# !!!!! ici, il faut reconstruire l'entr� de la table de hachage comme ci dessus
189
# 								# !!!!! ici, il faut reconstruire l'entr� de la table de hachage comme ci dessus
Lines 203-209 exit; Link Here
203
# 					if ($fieldnumber eq '711') {
203
# 					if ($fieldnumber eq '711') {
204
# 						$sthBIBLIOS711->execute($authentry);
204
# 						$sthBIBLIOS711->execute($authentry);
205
# 						while (my ($bibid,$tag,$tagorder,$subfieldorder) = $sthBIBLIOS711->fetchrow) {
205
# 						while (my ($bibid,$tag,$tagorder,$subfieldorder) = $sthBIBLIOS711->fetchrow) {
206
# 							my $inbiblio = GetMarcBiblio($bibid);
206
#                            my $inbiblio = GetMarcBiblio({ biblionumber => $bibid });
207
# 							my $isOK = 0;
207
# 							my $isOK = 0;
208
# 							foreach my $in7xx ($inbiblio->field($fieldnumber)) {
208
# 							foreach my $in7xx ($inbiblio->field($fieldnumber)) {
209
# 								# !!!!! ici, il faut reconstruire l'entr� de la table de hachage comme ci dessus
209
# 								# !!!!! ici, il faut reconstruire l'entr� de la table de hachage comme ci dessus
Lines 223-229 exit; Link Here
223
# 					if ($fieldnumber eq '712') {
223
# 					if ($fieldnumber eq '712') {
224
# 						$sthBIBLIOS712->execute($authentry);
224
# 						$sthBIBLIOS712->execute($authentry);
225
# 						while (my ($bibid,$tag,$tagorder,$subfieldorder) = $sthBIBLIOS712->fetchrow) {
225
# 						while (my ($bibid,$tag,$tagorder,$subfieldorder) = $sthBIBLIOS712->fetchrow) {
226
# 							my $inbiblio = GetMarcBiblio($bibid);
226
#                            my $inbiblio = GetMarcBiblio({ biblionumber => $bibid });
227
# 							my $isOK = 0;
227
# 							my $isOK = 0;
228
# 							foreach my $in7xx ($inbiblio->field($fieldnumber)) {
228
# 							foreach my $in7xx ($inbiblio->field($fieldnumber)) {
229
# 								# !!!!! ici, il faut reconstruire l'entr� de la table de hachage comme ci dessus
229
# 								# !!!!! ici, il faut reconstruire l'entr� de la table de hachage comme ci dessus
(-)a/misc/migration_tools/create_analytical_rel.pl (-1 / +1 lines)
Lines 81-87 _SUMMARY_ Link Here
81
sub process_bib {
81
sub process_bib {
82
    my $biblionumber = shift;
82
    my $biblionumber = shift;
83
83
84
    my $bib = GetMarcBiblio($biblionumber);
84
    my $bib = GetMarcBiblio({ biblionumber => $biblionumber });
85
    unless (defined $bib) {
85
    unless (defined $bib) {
86
        print "\nCould not retrieve bib $biblionumber from the database - record is corrupt.\n";
86
        print "\nCould not retrieve bib $biblionumber from the database - record is corrupt.\n";
87
        $num_bad_bibs++;
87
        $num_bad_bibs++;
(-)a/misc/migration_tools/import_lexile.pl (-1 / +1 lines)
Lines 152-158 while ( my $row = $csv->getline_hr($fh) ) { Link Here
152
152
153
    foreach my $biblionumber (@biblionumbers) {
153
    foreach my $biblionumber (@biblionumbers) {
154
        $counter++;
154
        $counter++;
155
        my $record = GetMarcBiblio($biblionumber);
155
        my $record = GetMarcBiblio({ biblionumber => $biblionumber });
156
156
157
        if ($verbose) {
157
        if ($verbose) {
158
            say "Found matching record! Biblionumber: $biblionumber";
158
            say "Found matching record! Biblionumber: $biblionumber";
(-)a/misc/migration_tools/rebuild_zebra.pl (-1 / +1 lines)
Lines 675-681 sub get_raw_marc_record { Link Here
675
675
676
    my $marc;
676
    my $marc;
677
    if ($record_type eq 'biblio') {
677
    if ($record_type eq 'biblio') {
678
        eval { $marc = GetMarcBiblio($record_number, 1); };
678
        eval { $marc = GetMarcBiblio({ biblionumber => $record_number, embed_items => 1 }); };
679
        if ($@ || !$marc) {
679
        if ($@ || !$marc) {
680
            # here we do warn since catching an exception
680
            # here we do warn since catching an exception
681
            # means that the bib was found but failed
681
            # means that the bib was found but failed
(-)a/misc/migration_tools/switch_marc21_series_info.pl (-1 / +1 lines)
Lines 139-145 while ( my ( $biblionumber ) = $bibs_sth->fetchrow ) { Link Here
139
    my ( @newfields );
139
    my ( @newfields );
140
140
141
    # Get biblio marc
141
    # Get biblio marc
142
    my $biblio = GetMarcBiblio( $biblionumber );
142
    my $biblio = GetMarcBiblio({ biblionumber => $biblionumber });
143
143
144
    foreach my $field ( $biblio->field( '440' ) ) {
144
    foreach my $field ( $biblio->field( '440' ) ) {
145
        my @newsubfields;
145
        my @newsubfields;
(-)a/misc/migration_tools/upgradeitems.pl (-1 / +1 lines)
Lines 18-24 my $rqitemnumber=$dbh->prepare("SELECT itemnumber, biblionumber from items where Link Here
18
$rqbiblios->execute;
18
$rqbiblios->execute;
19
$|=1;
19
$|=1;
20
while (my ($biblionumber)= $rqbiblios->fetchrow_array){
20
while (my ($biblionumber)= $rqbiblios->fetchrow_array){
21
    my $record=GetMarcBiblio($biblionumber);
21
    my $record=GetMarcBiblio({ biblionumber => $biblionumber });
22
    foreach my $itemfield ($record->field('995')){
22
    foreach my $itemfield ($record->field('995')){
23
        my $marcitem=MARC::Record->new();
23
        my $marcitem=MARC::Record->new();
24
        $marcitem->encoding('UTF-8');
24
        $marcitem->encoding('UTF-8');
(-)a/opac/opac-ISBDdetail.pl (-1 / +3 lines)
Lines 93-99 if (scalar @items >= 1) { Link Here
93
    }
93
    }
94
}
94
}
95
95
96
my $record = GetMarcBiblio($biblionumber,1);
96
my $record = GetMarcBiblio({
97
    biblionumber => $biblionumber,
98
    embed_items  => 1 });
97
if ( ! $record ) {
99
if ( ! $record ) {
98
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
100
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
99
    exit;
101
    exit;
(-)a/opac/opac-MARCdetail.pl (-1 / +3 lines)
Lines 71-77 if ( ! $biblionumber ) { Link Here
71
    exit;
71
    exit;
72
}
72
}
73
73
74
my $record = GetMarcBiblio($biblionumber, 1);
74
my $record = GetMarcBiblio({
75
    biblionumber => $biblionumber,
76
    embed_items  => 1 });
75
if ( ! $record ) {
77
if ( ! $record ) {
76
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
78
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
77
    exit;
79
    exit;
(-)a/opac/opac-basket.pl (-1 / +1 lines)
Lines 65-71 foreach my $biblionumber ( @bibs ) { Link Here
65
    my $dat              = &GetBiblioData($biblionumber);
65
    my $dat              = &GetBiblioData($biblionumber);
66
    next unless $dat;
66
    next unless $dat;
67
67
68
    my $record = &GetMarcBiblio( $biblionumber );
68
    my $record = &GetMarcBiblio({ biblionumber => $biblionumber });
69
    my $framework = &GetFrameworkCode( $biblionumber );
69
    my $framework = &GetFrameworkCode( $biblionumber );
70
    $record_processor->options({
70
    $record_processor->options({
71
        interface => 'opac',
71
        interface => 'opac',
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 90-96 if (scalar @all_items >= 1) { Link Here
90
    }
90
    }
91
}
91
}
92
92
93
my $record = GetMarcBiblio($biblionumber);
93
my $record = GetMarcBiblio({ biblionumber => $biblionumber });
94
if ( ! $record ) {
94
if ( ! $record ) {
95
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
95
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
96
    exit;
96
    exit;
(-)a/opac/opac-downloadcart.pl (-1 / +3 lines)
Lines 68-74 if ($bib_list && $format) { Link Here
68
        });
68
        });
69
        foreach my $biblio (@bibs) {
69
        foreach my $biblio (@bibs) {
70
70
71
            my $record = GetMarcBiblio($biblio, 1);
71
            my $record = GetMarcBiblio({
72
                biblionumber => $biblio,
73
                embed_items  => 1 });
72
            my $framework = &GetFrameworkCode( $biblio );
74
            my $framework = &GetFrameworkCode( $biblio );
73
            $record_processor->options({
75
            $record_processor->options({
74
                interface => 'opac',
76
                interface => 'opac',
(-)a/opac/opac-downloadshelf.pl (-1 / +3 lines)
Lines 81-87 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
81
            while ( my $content = $contents->next ) {
81
            while ( my $content = $contents->next ) {
82
                my $biblionumber = $content->biblionumber;
82
                my $biblionumber = $content->biblionumber;
83
83
84
                my $record = GetMarcBiblio($biblionumber, 1);
84
                my $record = GetMarcBiblio({
85
                    biblionumber => $biblionumber,
86
                    embed_items  => 1 });
85
                my $framework = &GetFrameworkCode( $biblionumber );
87
                my $framework = &GetFrameworkCode( $biblionumber );
86
                $record_processor->options({
88
                $record_processor->options({
87
                    interface => 'opac',
89
                    interface => 'opac',
(-)a/opac/opac-export.pl (-2 / +5 lines)
Lines 36-43 $biblionumber = int($biblionumber); Link Here
36
my $error = q{};
36
my $error = q{};
37
37
38
my $include_items = ($format =~ /bibtex/) ? 0 : 1;
38
my $include_items = ($format =~ /bibtex/) ? 0 : 1;
39
my $marc = GetMarcBiblio($biblionumber, $include_items)
39
my $marc = $biblionumber
40
    if $biblionumber;
40
    ? GetMarcBiblio({
41
        biblionumber => $biblionumber,
42
        embed_items  => $include_items })
43
    : undef;
41
44
42
if(!$marc) {
45
if(!$marc) {
43
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
46
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
(-)a/opac/opac-reserve.pl (-2 / +2 lines)
Lines 159-165 foreach my $biblioNumber (@biblionumbers) { Link Here
159
159
160
    my @itemInfos = GetItemsInfo($biblioNumber);
160
    my @itemInfos = GetItemsInfo($biblioNumber);
161
161
162
    my $marcrecord= GetMarcBiblio($biblioNumber);
162
    my $marcrecord= GetMarcBiblio({ biblionumber => $biblioNumber });
163
163
164
    # flag indicating existence of at least one item linked via a host record
164
    # flag indicating existence of at least one item linked via a host record
165
    my $hostitemsflag;
165
    my $hostitemsflag;
Lines 401-407 $template->param('item_level_itypes' => $itemLevelTypes); Link Here
401
foreach my $biblioNum (@biblionumbers) {
401
foreach my $biblioNum (@biblionumbers) {
402
402
403
    my @not_available_at = ();
403
    my @not_available_at = ();
404
    my $record = GetMarcBiblio($biblioNum);
404
    my $record = GetMarcBiblio({ biblionumber => $biblioNum });
405
    # Init the bib item with the choices for branch pickup
405
    # Init the bib item with the choices for branch pickup
406
    my %biblioLoopIter;
406
    my %biblioLoopIter;
407
407
(-)a/opac/opac-search.pl (-1 / +1 lines)
Lines 659-665 for (my $i=0;$i<@servers;$i++) { Link Here
659
            }
659
            }
660
660
661
            if (C4::Context->preference('COinSinOPACResults')) {
661
            if (C4::Context->preference('COinSinOPACResults')) {
662
                my $record = GetMarcBiblio($res->{'biblionumber'});
662
                my $record = GetMarcBiblio({ biblionumber => $res->{'biblionumber'} });
663
                $res->{coins} = GetCOinSBiblio($record);
663
                $res->{coins} = GetCOinSBiblio($record);
664
            }
664
            }
665
            if ( C4::Context->preference( "Babeltheque" ) and $res->{normalized_isbn} ) {
665
            if ( C4::Context->preference( "Babeltheque" ) and $res->{normalized_isbn} ) {
(-)a/opac/opac-sendbasket.pl (-1 / +3 lines)
Lines 87-93 if ( $email_add ) { Link Here
87
87
88
        my $dat              = GetBiblioData($biblionumber);
88
        my $dat              = GetBiblioData($biblionumber);
89
        next unless $dat;
89
        next unless $dat;
90
        my $record           = GetMarcBiblio($biblionumber, 1);
90
        my $record           = GetMarcBiblio({
91
            biblionumber => $biblionumber,
92
            embed_items  => 1 });
91
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
93
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
92
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
94
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
93
95
(-)a/opac/opac-sendshelf.pl (-1 / +3 lines)
Lines 90-96 if ( $email ) { Link Here
90
        my $biblionumber = $content->biblionumber;
90
        my $biblionumber = $content->biblionumber;
91
        my $fw               = GetFrameworkCode($biblionumber);
91
        my $fw               = GetFrameworkCode($biblionumber);
92
        my $dat              = GetBiblioData($biblionumber);
92
        my $dat              = GetBiblioData($biblionumber);
93
        my $record           = GetMarcBiblio($biblionumber, 1);
93
        my $record           = GetMarcBiblio({
94
            biblionumber => $biblionumber,
95
            embed_items  => 1 });
94
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
96
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
95
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
97
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
96
        my $subtitle         = GetRecordValue('subtitle', $record, $fw);
98
        my $subtitle         = GetRecordValue('subtitle', $record, $fw);
(-)a/opac/opac-shelves.pl (-1 / +1 lines)
Lines 270-276 if ( $op eq 'view' ) { Link Here
270
            while ( my $content = $contents->next ) {
270
            while ( my $content = $contents->next ) {
271
                my $biblionumber = $content->biblionumber;
271
                my $biblionumber = $content->biblionumber;
272
                my $this_item    = GetBiblioData($biblionumber);
272
                my $this_item    = GetBiblioData($biblionumber);
273
                my $record = GetMarcBiblio($biblionumber);
273
                my $record = GetMarcBiblio({ biblionumber => $biblionumber });
274
                my $framework = GetFrameworkCode( $biblionumber );
274
                my $framework = GetFrameworkCode( $biblionumber );
275
                $record_processor->options({
275
                $record_processor->options({
276
                    interface => 'opac',
276
                    interface => 'opac',
(-)a/opac/opac-showmarc.pl (-1 / +1 lines)
Lines 47-53 if ($importid) { Link Here
47
    $record = MARC::Record->new_from_usmarc($marc);
47
    $record = MARC::Record->new_from_usmarc($marc);
48
}
48
}
49
else {
49
else {
50
    $record = GetMarcBiblio($biblionumber);
50
    $record = GetMarcBiblio({ biblionumber => $biblionumber });
51
    my $framework = GetFrameworkCode($biblionumber);
51
    my $framework = GetFrameworkCode($biblionumber);
52
    $record_processor->options({
52
    $record_processor->options({
53
        interface => 'opac',
53
        interface => 'opac',
(-)a/opac/opac-showreviews.pl (-1 / +1 lines)
Lines 91-97 for my $result (@$reviews){ Link Here
91
    my $biblionumber = $result->{biblionumber};
91
    my $biblionumber = $result->{biblionumber};
92
    my $biblio = Koha::Biblios->find( $biblionumber );
92
    my $biblio = Koha::Biblios->find( $biblionumber );
93
    my $biblioitem = $biblio->biblioitem;
93
    my $biblioitem = $biblio->biblioitem;
94
    my $record = GetMarcBiblio($biblionumber);
94
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
95
    my $frameworkcode = GetFrameworkCode($biblionumber);
95
    my $frameworkcode = GetFrameworkCode($biblionumber);
96
    my $borr = Koha::Patrons->find( $result->{borrowernumber} )->unblessed;
96
    my $borr = Koha::Patrons->find( $result->{borrowernumber} )->unblessed;
97
	$result->{normalized_upc} = GetNormalizedUPC($record,$marcflavour);
97
	$result->{normalized_upc} = GetNormalizedUPC($record,$marcflavour);
(-)a/opac/opac-tags.pl (-1 / +1 lines)
Lines 232-238 if ($loggedinuser) { Link Here
232
    my $my_approved_tags = get_approval_rows({ approved => 1 });
232
    my $my_approved_tags = get_approval_rows({ approved => 1 });
233
    foreach my $tag (@$my_tags) {
233
    foreach my $tag (@$my_tags) {
234
        my $biblio = Koha::Biblios->find( $tag->{biblionumber} );
234
        my $biblio = Koha::Biblios->find( $tag->{biblionumber} );
235
        my $record = &GetMarcBiblio( $tag->{biblionumber} );
235
        my $record = &GetMarcBiblio({ biblionumber => $tag->{biblionumber} });
236
        $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) );
236
        $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) );
237
        $tag->{title} = $biblio->title;
237
        $tag->{title} = $biblio->title;
238
        $tag->{author} = $biblio->author;
238
        $tag->{author} = $biblio->author;
(-)a/opac/opac-user.pl (-1 / +1 lines)
Lines 204-210 if ($issues){ Link Here
204
        }
204
        }
205
        $issue->{'charges'} = $charges;
205
        $issue->{'charges'} = $charges;
206
        $issue->{'rentalfines'} = $rentalfines;
206
        $issue->{'rentalfines'} = $rentalfines;
207
        my $marcrecord = GetMarcBiblio( $issue->{'biblionumber'} );
207
        my $marcrecord = GetMarcBiblio({ biblionumber => $issue->{'biblionumber'} });
208
        $issue->{'subtitle'} = GetRecordValue('subtitle', $marcrecord, GetFrameworkCode($issue->{'biblionumber'}));
208
        $issue->{'subtitle'} = GetRecordValue('subtitle', $marcrecord, GetFrameworkCode($issue->{'biblionumber'}));
209
        # check if item is renewable
209
        # check if item is renewable
210
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
210
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
(-)a/serials/subscription-add.pl (-1 / +3 lines)
Lines 439-445 sub redirect_mod_subscription { Link Here
439
439
440
sub insert_additional_fields {
440
sub insert_additional_fields {
441
    my ( $additional_fields, $biblionumber, $subscriptionid ) = @_;
441
    my ( $additional_fields, $biblionumber, $subscriptionid ) = @_;
442
    my $record = GetMarcBiblio( $biblionumber, 1 );
442
    my $record = GetMarcBiblio({
443
        biblionumber => $biblionumber,
444
        embed_items  => 1 });
443
    for my $field ( @$additional_fields ) {
445
    for my $field ( @$additional_fields ) {
444
        my $af = Koha::AdditionalField->new({ id => $field->{id} })->fetch;
446
        my $af = Koha::AdditionalField->new({ id => $field->{id} })->fetch;
445
        if ( $af->{marcfield} ) {
447
        if ( $af->{marcfield} ) {
(-)a/svc/bib (-4 / +7 lines)
Lines 66-72 exit 0; Link Here
66
sub fetch_bib {
66
sub fetch_bib {
67
    my $query = shift;
67
    my $query = shift;
68
    my $biblionumber = shift;
68
    my $biblionumber = shift;
69
    my $record = GetMarcBiblio( $biblionumber, $query->url_param('items') );
69
    my $record = GetMarcBiblio({
70
        biblionumber => $biblionumber,
71
        embed_items  => $query->url_param('items') });
70
    if  (defined $record) {
72
    if  (defined $record) {
71
        print $query->header(-type => 'text/xml',-charset => 'utf-8',);
73
        print $query->header(-type => 'text/xml',-charset => 'utf-8',);
72
        print $record->as_xml_record();
74
        print $record->as_xml_record();
Lines 78-84 sub fetch_bib { Link Here
78
sub update_bib {
80
sub update_bib {
79
    my $query = shift;
81
    my $query = shift;
80
    my $biblionumber = shift;
82
    my $biblionumber = shift;
81
    my $old_record = GetMarcBiblio($biblionumber);
83
    my $old_record = GetMarcBiblio({ biblionumber => $biblionumber });
82
    unless  (defined $old_record) {
84
    unless  (defined $old_record) {
83
        print $query->header(-type => 'text/xml', -status => '404 Not Found');
85
        print $query->header(-type => 'text/xml', -status => '404 Not Found');
84
        return;
86
        return;
Lines 113-120 sub update_bib { Link Here
113
        }
115
        }
114
116
115
        ModBiblio( $record, $biblionumber, '' );
117
        ModBiblio( $record, $biblionumber, '' );
116
        my $new_record =
118
        my $new_record = GetMarcBiblio({
117
          GetMarcBiblio( $biblionumber, $query->url_param('items') );
119
            biblionumber => $biblionumber,
120
            embed_items  => $query->url_param('items') });
118
121
119
        $result->{'status'} = "ok";
122
        $result->{'status'} = "ok";
120
        $result->{'biblionumber'} = $biblionumber;
123
        $result->{'biblionumber'} = $biblionumber;
(-)a/svc/checkouts (-2 / +4 lines)
Lines 209-216 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
209
                as_due_date => 1
209
                as_due_date => 1
210
            }
210
            }
211
        ),
211
        ),
212
        subtitle =>
212
        subtitle => GetRecordValue(
213
          GetRecordValue( 'subtitle', GetMarcBiblio( $c->{biblionumber} ), GetFrameworkCode( $c->{biblionumber} ) ),
213
            'subtitle',
214
            GetMarcBiblio({ biblionumber => $c->{biblionumber} }),
215
            GetFrameworkCode( $c->{biblionumber} ) ),
214
        lost    => $lost,
216
        lost    => $lost,
215
        damaged => $damaged,
217
        damaged => $damaged,
216
        borrower => {
218
        borrower => {
(-)a/svc/holds (-1 / +2 lines)
Lines 103-109 while ( my $h = $holds_rs->next() ) { Link Here
103
        priority       => $h->priority(),
103
        priority       => $h->priority(),
104
        itemtype_limit => $itemtype_limit,
104
        itemtype_limit => $itemtype_limit,
105
        subtitle       => GetRecordValue(
105
        subtitle       => GetRecordValue(
106
            'subtitle', GetMarcBiblio($biblionumber),
106
            'subtitle',
107
            GetMarcBiblio({ biblionumber => $biblionumber }),
107
            GetFrameworkCode($biblionumber)
108
            GetFrameworkCode($biblionumber)
108
        ),
109
        ),
109
        reservedate_formatted => $h->reservedate() ? output_pref(
110
        reservedate_formatted => $h->reservedate() ? output_pref(
(-)a/svc/new_bib (-3 / +4 lines)
Lines 75-81 sub add_bib { Link Here
75
            $record->delete_field($field);
75
            $record->delete_field($field);
76
        }
76
        }
77
        my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, '' );
77
        my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, '' );
78
        my $new_record = GetMarcBiblio($biblionumber);
78
        my $new_record = GetMarcBiblio({ biblionumber => $biblionumber });
79
        if ( $query->url_param('items') ) {
79
        if ( $query->url_param('items') ) {
80
            foreach my $field ( $fullrecord->field($itemtag) ) {
80
            foreach my $field ( $fullrecord->field($itemtag) ) {
81
                my $one_item_record = $new_record->clone();
81
                my $one_item_record = $new_record->clone();
Lines 84-91 sub add_bib { Link Here
84
            }
84
            }
85
        }
85
        }
86
86
87
        $new_record =
87
        $new_record = GetMarcBiblio({
88
          GetMarcBiblio( $biblionumber, $query->url_param('items') );
88
            biblionumber => $biblionumber,
89
            embed_items  => $query->url_param('items') });
89
        $result->{'status'} = "ok";
90
        $result->{'status'} = "ok";
90
        $result->{'biblionumber'} = $biblionumber;
91
        $result->{'biblionumber'} = $biblionumber;
91
        my $xml = $new_record->as_xml_record();
92
        my $xml = $new_record->as_xml_record();
(-)a/svc/records/preview (-1 / +1 lines)
Lines 32-38 my $mmtid = $query->param('mmtid'); # Marc modification template id Link Here
32
32
33
my $record;
33
my $record;
34
if ( $record_type eq 'biblio' ) {
34
if ( $record_type eq 'biblio' ) {
35
    $record = GetMarcBiblio( $record_id );
35
    $record = GetMarcBiblio({ biblionumber => $record_id });
36
} else {
36
} else {
37
    my $authority = Koha::MetadataRecord::Authority->get_from_authid( $record_id );
37
    my $authority = Koha::MetadataRecord::Authority->get_from_authid( $record_id );
38
    $record = $authority->record;
38
    $record = $authority->record;
(-)a/t/Biblio.t (-1 / +5 lines)
Lines 25-31 use Module::Load::Conditional qw/check_install/; Link Here
25
25
26
BEGIN {
26
BEGIN {
27
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
27
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
28
        plan tests => 46;
28
        plan tests => 47;
29
    } else {
29
    } else {
30
        plan skip_all => "Need Test::DBIx::Class"
30
        plan skip_all => "Need Test::DBIx::Class"
31
    }
31
    }
Lines 181-186 warning_is { $ret = RemoveAllNsb() } Link Here
181
ok( !defined $ret, 'RemoveAllNsb returns undef if not passed rec');
181
ok( !defined $ret, 'RemoveAllNsb returns undef if not passed rec');
182
182
183
warning_is { $ret = GetMarcBiblio() }
183
warning_is { $ret = GetMarcBiblio() }
184
           { carped => 'GetMarcBiblio called without parameters'},
185
           "GetMarcBiblio returns carped warning on no parameters";
186
187
warning_is { $ret = GetMarcBiblio({ biblionumber => undef }) }
184
           { carped => 'GetMarcBiblio called with undefined biblionumber'},
188
           { carped => 'GetMarcBiblio called with undefined biblionumber'},
185
           "GetMarcBiblio returns carped warning on undef biblionumber";
189
           "GetMarcBiblio returns carped warning on undef biblionumber";
186
190
(-)a/t/db_dependent/Authorities/Merge.t (-12 / +12 lines)
Lines 94-106 subtest 'Test merge A1 to A2 (within same authtype)' => sub { Link Here
94
    is( $rv, 1, 'We expect one biblio record (out of two) to be updated' );
94
    is( $rv, 1, 'We expect one biblio record (out of two) to be updated' );
95
95
96
    # Check the results
96
    # Check the results
97
    my $newbiblio1 = GetMarcBiblio($biblionumber1);
97
    my $newbiblio1 = GetMarcBiblio({ biblionumber => $biblionumber1 });
98
    compare_fields( $biblio1, $newbiblio1, {}, 'count' );
98
    compare_fields( $biblio1, $newbiblio1, {}, 'count' );
99
    compare_fields( $biblio1, $newbiblio1, {}, 'order' );
99
    compare_fields( $biblio1, $newbiblio1, {}, 'order' );
100
    is( $newbiblio1->subfield('609', '9'), $authid1, 'Check biblio1 609$9' );
100
    is( $newbiblio1->subfield('609', '9'), $authid1, 'Check biblio1 609$9' );
101
    is( $newbiblio1->subfield('609', 'a'), 'George Orwell',
101
    is( $newbiblio1->subfield('609', 'a'), 'George Orwell',
102
        'Check biblio1 609$a' );
102
        'Check biblio1 609$a' );
103
    my $newbiblio2 = GetMarcBiblio($biblionumber2);
103
    my $newbiblio2 = GetMarcBiblio({ biblionumber => $biblionumber2 });
104
    compare_fields( $biblio2, $newbiblio2, {}, 'count' );
104
    compare_fields( $biblio2, $newbiblio2, {}, 'count' );
105
    compare_fields( $biblio2, $newbiblio2, {}, 'order' );
105
    compare_fields( $biblio2, $newbiblio2, {}, 'order' );
106
    is( $newbiblio2->subfield('609', '9'), $authid1, 'Check biblio2 609$9' );
106
    is( $newbiblio2->subfield('609', '9'), $authid1, 'Check biblio2 609$9' );
Lines 138-148 subtest 'Test merge A1 to modified A1, test strict mode' => sub { Link Here
138
    is( $rv, 2, 'Both records are updated now' );
138
    is( $rv, 2, 'Both records are updated now' );
139
139
140
    #Check the results
140
    #Check the results
141
    my $biblio1 = GetMarcBiblio($biblionumber1);
141
    my $biblio1 = GetMarcBiblio({ biblionumber => $biblionumber1 });
142
    compare_fields( $MARC1, $biblio1, {}, 'count' );
142
    compare_fields( $MARC1, $biblio1, {}, 'count' );
143
    compare_fields( $MARC1, $biblio1, {}, 'order' );
143
    compare_fields( $MARC1, $biblio1, {}, 'order' );
144
    is( $auth1new->field(109)->subfield('a'), $biblio1->field(109)->subfield('a'), 'Record1 values updated correctly' );
144
    is( $auth1new->field(109)->subfield('a'), $biblio1->field(109)->subfield('a'), 'Record1 values updated correctly' );
145
    my $biblio2 = GetMarcBiblio( $biblionumber2 );
145
    my $biblio2 = GetMarcBiblio({ biblionumber => $biblionumber2 });
146
    compare_fields( $MARC2, $biblio2, {}, 'count' );
146
    compare_fields( $MARC2, $biblio2, {}, 'count' );
147
    compare_fields( $MARC2, $biblio2, {}, 'order' );
147
    compare_fields( $MARC2, $biblio2, {}, 'order' );
148
    is( $auth1new->field(109)->subfield('a'), $biblio2->field(109)->subfield('a'), 'Record2 values updated correctly' );
148
    is( $auth1new->field(109)->subfield('a'), $biblio2->field(109)->subfield('a'), 'Record2 values updated correctly' );
Lines 154-160 subtest 'Test merge A1 to modified A1, test strict mode' => sub { Link Here
154
    ModBiblio( $MARC1, $biblionumber1, '' );
154
    ModBiblio( $MARC1, $biblionumber1, '' );
155
    @linkedrecords = ( $biblionumber1 );
155
    @linkedrecords = ( $biblionumber1 );
156
    $rv = C4::AuthoritiesMarc::merge({ mergefrom => $authid1, MARCfrom => $auth1old, mergeto => $authid1, MARCto => $auth1new });
156
    $rv = C4::AuthoritiesMarc::merge({ mergefrom => $authid1, MARCfrom => $auth1old, mergeto => $authid1, MARCto => $auth1new });
157
    $biblio1 = GetMarcBiblio($biblionumber1);
157
    $biblio1 = GetMarcBiblio({ biblionumber => $biblionumber1 });
158
    is( $biblio1->field(109)->subfield('b'), undef, 'Subfield overwritten in strict mode' );
158
    is( $biblio1->field(109)->subfield('b'), undef, 'Subfield overwritten in strict mode' );
159
    compare_fields( $MARC1, $biblio1, { 609 => 1 }, 'count' );
159
    compare_fields( $MARC1, $biblio1, { 609 => 1 }, 'count' );
160
    my @old609 = $MARC1->field('609');
160
    my @old609 = $MARC1->field('609');
Lines 195-201 subtest 'Test merge A1 to B1 (changing authtype)' => sub { Link Here
195
        MARC::Field->new( '612', '', '', a => 'unrelated', 9 => 'other' ),
195
        MARC::Field->new( '612', '', '', a => 'unrelated', 9 => 'other' ),
196
    );
196
    );
197
    my ( $biblionumber ) = C4::Biblio::AddBiblio( $marc, '' );
197
    my ( $biblionumber ) = C4::Biblio::AddBiblio( $marc, '' );
198
    my $oldbiblio = C4::Biblio::GetMarcBiblio( $biblionumber );
198
    my $oldbiblio = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
199
199
200
    # Time to merge
200
    # Time to merge
201
    @linkedrecords = ( $biblionumber );
201
    @linkedrecords = ( $biblionumber );
Lines 203-209 subtest 'Test merge A1 to B1 (changing authtype)' => sub { Link Here
203
    is( $retval, 1, 'We touched only one biblio' );
203
    is( $retval, 1, 'We touched only one biblio' );
204
204
205
    # Get new marc record for compares
205
    # Get new marc record for compares
206
    my $newbiblio = C4::Biblio::GetMarcBiblio( $biblionumber );
206
    my $newbiblio = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
207
    compare_fields( $oldbiblio, $newbiblio, {}, 'count' );
207
    compare_fields( $oldbiblio, $newbiblio, {}, 'count' );
208
    # Exclude 109/609 and 112/612 in comparing order
208
    # Exclude 109/609 and 112/612 in comparing order
209
    my $excl = { '109' => 1, '112' => 1, '609' => 1, '612' => 1 };
209
    my $excl = { '109' => 1, '112' => 1, '609' => 1, '612' => 1 };
Lines 260-266 subtest 'Merging authorities should handle deletes (BZ 18070)' => sub { Link Here
260
    DelAuthority({ authid => $authid1 }); # this triggers a merge call
260
    DelAuthority({ authid => $authid1 }); # this triggers a merge call
261
261
262
    # See what happened in the biblio record
262
    # See what happened in the biblio record
263
    my $marc1 = C4::Biblio::GetMarcBiblio( $biblionumber );
263
    my $marc1 = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
264
    is( $marc1->field('609'), undef, 'Field 609 should be gone too' );
264
    is( $marc1->field('609'), undef, 'Field 609 should be gone too' );
265
265
266
    # Now we simulate the delete as done in the cron job
266
    # Now we simulate the delete as done in the cron job
Lines 282-288 subtest 'Merging authorities should handle deletes (BZ 18070)' => sub { Link Here
282
    $mocks->{auth_mod}->unmock_all;
282
    $mocks->{auth_mod}->unmock_all;
283
    merge({ mergefrom => $authid1, biblionumbers => [ $biblionumber ] });
283
    merge({ mergefrom => $authid1, biblionumbers => [ $biblionumber ] });
284
    # Final check
284
    # Final check
285
    $marc1 = C4::Biblio::GetMarcBiblio( $biblionumber );
285
    $marc1 = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
286
    is( $marc1->field('609'), undef, 'Merge removed the 609 again even after deleting the authority record' );
286
    is( $marc1->field('609'), undef, 'Merge removed the 609 again even after deleting the authority record' );
287
};
287
};
288
288
Lines 306-319 subtest "Test some specific postponed merge issues" => sub { Link Here
306
    # This proves the !authtypefrom condition in sub merge
306
    # This proves the !authtypefrom condition in sub merge
307
    # Additionally, we test clearing subfield
307
    # Additionally, we test clearing subfield
308
    merge({ mergefrom => $id + 1, MARCfrom => $oldauthmarc, mergeto => $id, MARCto => $authmarc, biblionumbers => [ $biblionumber ] });
308
    merge({ mergefrom => $id + 1, MARCfrom => $oldauthmarc, mergeto => $id, MARCto => $authmarc, biblionumbers => [ $biblionumber ] });
309
    $biblio = C4::Biblio::GetMarcBiblio( $biblionumber );
309
    $biblio = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
310
    is( $biblio->subfield('609', '9'), $id, '612 moved to 609' );
310
    is( $biblio->subfield('609', '9'), $id, '612 moved to 609' );
311
    is( $biblio->subfield('609', 'c'), undef, '609c cleared correctly' );
311
    is( $biblio->subfield('609', 'c'), undef, '609c cleared correctly' );
312
312
313
    # Merge A to B postponed, delete B immediately (hits B < hits A)
313
    # Merge A to B postponed, delete B immediately (hits B < hits A)
314
    # This proves the !@record_to test in sub merge
314
    # This proves the !@record_to test in sub merge
315
    merge({ mergefrom => $id + 2, mergeto => $id + 1, MARCto => undef, biblionumbers => [ $biblionumber ] });
315
    merge({ mergefrom => $id + 2, mergeto => $id + 1, MARCto => undef, biblionumbers => [ $biblionumber ] });
316
    $biblio = C4::Biblio::GetMarcBiblio( $biblionumber );
316
    $biblio = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
317
    is( $biblio->field('612'), undef, 'Last 612 must be gone' );
317
    is( $biblio->field('612'), undef, 'Last 612 must be gone' );
318
318
319
    # Show that we 'need' skip_merge; this example is far-fetched.
319
    # Show that we 'need' skip_merge; this example is far-fetched.
Lines 325-331 subtest "Test some specific postponed merge issues" => sub { Link Here
325
    my $restored_mocks = set_mocks();
325
    my $restored_mocks = set_mocks();
326
    DelAuthority({ authid => $id, skip_merge => 1 }); # delete A
326
    DelAuthority({ authid => $id, skip_merge => 1 }); # delete A
327
    $restored_mocks->{auth_mod}->unmock_all;
327
    $restored_mocks->{auth_mod}->unmock_all;
328
    $biblio = C4::Biblio::GetMarcBiblio( $biblionumber );
328
    $biblio = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
329
    is( $biblio->subfield('109', '9'), $id, 'If the 109 is no longer present, another modify merge would not bring it back' );
329
    is( $biblio->subfield('109', '9'), $id, 'If the 109 is no longer present, another modify merge would not bring it back' );
330
};
330
};
331
331
(-)a/t/db_dependent/Biblio.t (-3 / +5 lines)
Lines 120-126 sub run_tests { Link Here
120
        '(GetBiblioData) Title field is empty in fresh biblio.');
120
        '(GetBiblioData) Title field is empty in fresh biblio.');
121
121
122
    my ( $isbn_field, $isbn_subfield ) = get_isbn_field();
122
    my ( $isbn_field, $isbn_subfield ) = get_isbn_field();
123
    my $marc = GetMarcBiblio( $biblionumber );
123
    my $marc = GetMarcBiblio({ biblionumber => $biblionumber });
124
    is( $marc->subfield( $isbn_field, $isbn_subfield ), $isbn, );
124
    is( $marc->subfield( $isbn_field, $isbn_subfield ), $isbn, );
125
125
126
    # Add title
126
    # Add title
Lines 131-137 sub run_tests { Link Here
131
    is( $data->{ title }, $title,
131
    is( $data->{ title }, $title,
132
        'ModBiblio correctly added the title field, and GetBiblioData.');
132
        'ModBiblio correctly added the title field, and GetBiblioData.');
133
    is( $data->{ isbn }, $isbn, '(ModBiblio) ISBN is still there after ModBiblio.');
133
    is( $data->{ isbn }, $isbn, '(ModBiblio) ISBN is still there after ModBiblio.');
134
    $marc = GetMarcBiblio( $biblionumber );
134
    $marc = GetMarcBiblio({ biblionumber => $biblionumber });
135
    my ( $title_field, $title_subfield ) = get_title_field();
135
    my ( $title_field, $title_subfield ) = get_title_field();
136
    is( $marc->subfield( $title_field, $title_subfield ), $title, );
136
    is( $marc->subfield( $title_field, $title_subfield ), $title, );
137
137
Lines 253-259 sub run_tests { Link Here
253
        "GetMarcPrice returns the correct value");
253
        "GetMarcPrice returns the correct value");
254
    my $newincbiblioitemnumber=$biblioitemnumber+1;
254
    my $newincbiblioitemnumber=$biblioitemnumber+1;
255
    $dbh->do("UPDATE biblioitems SET biblioitemnumber = ? WHERE biblionumber = ?;", undef, $newincbiblioitemnumber, $biblionumber );
255
    $dbh->do("UPDATE biblioitems SET biblioitemnumber = ? WHERE biblionumber = ?;", undef, $newincbiblioitemnumber, $biblionumber );
256
    my $updatedrecord = GetMarcBiblio($biblionumber, 0);
256
    my $updatedrecord = GetMarcBiblio({
257
        biblionumber => $biblionumber,
258
        embed_items  => 0 });
257
    my $frameworkcode = GetFrameworkCode($biblionumber);
259
    my $frameworkcode = GetFrameworkCode($biblionumber);
258
    my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.biblioitemnumber", $frameworkcode );
260
    my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.biblioitemnumber", $frameworkcode );
259
    die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblioitem_tag;
261
    die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblioitem_tag;
(-)a/t/db_dependent/Items.t (-1 / +1 lines)
Lines 557-563 subtest 'C4::Biblio::EmbedItemsInMarcBiblio' => sub { Link Here
557
557
558
    my ($itemfield) =
558
    my ($itemfield) =
559
      C4::Biblio::GetMarcFromKohaField( 'items.itemnumber', '' );
559
      C4::Biblio::GetMarcFromKohaField( 'items.itemnumber', '' );
560
    my $record = C4::Biblio::GetMarcBiblio($biblionumber);
560
    my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
561
    warning_is { C4::Biblio::EmbedItemsInMarcBiblio() }
561
    warning_is { C4::Biblio::EmbedItemsInMarcBiblio() }
562
    { carped => 'EmbedItemsInMarcBiblio: No MARC record passed' },
562
    { carped => 'EmbedItemsInMarcBiblio: No MARC record passed' },
563
      'Should crap is no record passed.';
563
      'Should crap is no record passed.';
(-)a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t (-2 / +2 lines)
Lines 93-99 subtest 'EmbedItemsAvailability tests' => sub { Link Here
93
    my $processor = Koha::RecordProcessor->new( { filters => ('EmbedItemsAvailability') } );
93
    my $processor = Koha::RecordProcessor->new( { filters => ('EmbedItemsAvailability') } );
94
    is( ref($processor), 'Koha::RecordProcessor', 'Created record processor' );
94
    is( ref($processor), 'Koha::RecordProcessor', 'Created record processor' );
95
95
96
    my $record = GetMarcBiblio($biblionumber);
96
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
97
    ok( !defined $record->field('999')->subfield('x'), q{The record doesn't originally contain 999$x} );
97
    ok( !defined $record->field('999')->subfield('x'), q{The record doesn't originally contain 999$x} );
98
    # Apply filter
98
    # Apply filter
99
    $processor->process($record);
99
    $processor->process($record);
Lines 141-147 subtest 'EmbedItemsAvailability tests' => sub { Link Here
141
    $processor = Koha::RecordProcessor->new( { filters => ('EmbedItemsAvailability') } );
141
    $processor = Koha::RecordProcessor->new( { filters => ('EmbedItemsAvailability') } );
142
    is( ref($processor), 'Koha::RecordProcessor', 'Created record processor' );
142
    is( ref($processor), 'Koha::RecordProcessor', 'Created record processor' );
143
143
144
    $record = GetMarcBiblio($biblionumber);
144
    $record = GetMarcBiblio({ biblionumber => $biblionumber });
145
    ok( !defined $record->subfield('999', 'x'), q{The record doesn't originally contain 999$x} );
145
    ok( !defined $record->subfield('999', 'x'), q{The record doesn't originally contain 999$x} );
146
    # Apply filter
146
    # Apply filter
147
    $processor->process($record);
147
    $processor->process($record);
(-)a/t/db_dependent/OAI/Server.t (-1 / +1 lines)
Lines 86-92 foreach my $index ( 0 .. NUMBER_OF_MARC_RECORDS - 1 ) { Link Here
86
    my $timestamp = $sth->fetchrow_array . 'Z';
86
    my $timestamp = $sth->fetchrow_array . 'Z';
87
    $timestamp =~ s/ /T/;
87
    $timestamp =~ s/ /T/;
88
    $timestamp = manipulate_timestamp( $index, $biblionumber, $timestamp );
88
    $timestamp = manipulate_timestamp( $index, $biblionumber, $timestamp );
89
    $record = GetMarcBiblio($biblionumber);
89
    $record = GetMarcBiblio({ biblionumber => $biblionumber });
90
    $record = XMLin($record->as_xml_record);
90
    $record = XMLin($record->as_xml_record);
91
    push @header, { datestamp => $timestamp, identifier => "TEST:$biblionumber" };
91
    push @header, { datestamp => $timestamp, identifier => "TEST:$biblionumber" };
92
    push @oaidc, {
92
    push @oaidc, {
(-)a/t/db_dependent/OAI/Sets.t (-2 / +2 lines)
Lines 520-526 ModOAISetMappings($setVH_id, $mappingsVH); Link Here
520
my $biblionumberVH = create_helper_biblio('Victor Hugo');
520
my $biblionumberVH = create_helper_biblio('Victor Hugo');
521
521
522
#Update
522
#Update
523
my $record = GetMarcBiblio($biblionumberVH);
523
my $record = GetMarcBiblio({ biblionumber => $biblionumberVH });
524
UpdateOAISetsBiblio($biblionumberVH, $record);
524
UpdateOAISetsBiblio($biblionumberVH, $record);
525
525
526
#is biblio attached to setVH ?
526
#is biblio attached to setVH ?
Lines 575-581 ModOAISetMappings($setNotVH_id, $mappingsNotVH); Link Here
575
my $biblionumberNotVH = create_helper_biblio('Sponge, Bob');
575
my $biblionumberNotVH = create_helper_biblio('Sponge, Bob');
576
576
577
#Update
577
#Update
578
$record = GetMarcBiblio($biblionumberNotVH);
578
$record = GetMarcBiblio({ biblionumber => $biblionumberNotVH });
579
UpdateOAISetsBiblio($biblionumberNotVH, $record);
579
UpdateOAISetsBiblio($biblionumberNotVH, $record);
580
580
581
my @setsNotEq = CalcOAISetsBiblio($record);
581
my @setsNotEq = CalcOAISetsBiblio($record);
(-)a/t/db_dependent/Reserves.t (-1 / +1 lines)
Lines 529-535 t::lib::Mocks::mock_preference( 'AgeRestrictionMarker', 'FSK|PEGI|Age|K' ); Link Here
529
#Reserving an not-agerestricted Biblio by a Borrower with no dateofbirth is tested previously.
529
#Reserving an not-agerestricted Biblio by a Borrower with no dateofbirth is tested previously.
530
530
531
#Set the ageRestriction for the Biblio
531
#Set the ageRestriction for the Biblio
532
my $record = GetMarcBiblio( $bibnum );
532
my $record = GetMarcBiblio({ biblionumber =>  $bibnum });
533
my ( $ageres_tagid, $ageres_subfieldid ) = GetMarcFromKohaField( "biblioitems.agerestriction" );
533
my ( $ageres_tagid, $ageres_subfieldid ) = GetMarcFromKohaField( "biblioitems.agerestriction" );
534
$record->append_fields(  MARC::Field->new($ageres_tagid, '', '', $ageres_subfieldid => 'PEGI 16')  );
534
$record->append_fields(  MARC::Field->new($ageres_tagid, '', '', $ageres_subfieldid => 'PEGI 16')  );
535
C4::Biblio::ModBiblio( $record, $bibnum, $frameworkcode );
535
C4::Biblio::ModBiblio( $record, $bibnum, $frameworkcode );
(-)a/tags/list.pl (-1 / +1 lines)
Lines 62-68 else { Link Here
62
        my $taglist = get_tag_rows( { term => $tag } );
62
        my $taglist = get_tag_rows( { term => $tag } );
63
        for ( @{$taglist} ) {
63
        for ( @{$taglist} ) {
64
            my $dat    = &GetBiblioData( $_->{biblionumber} );
64
            my $dat    = &GetBiblioData( $_->{biblionumber} );
65
            my $record = &GetMarcBiblio( $_->{biblionumber} );
65
            my $record = &GetMarcBiblio({ biblionumber => $_->{biblionumber} });
66
            $dat->{'subtitle'} =
66
            $dat->{'subtitle'} =
67
              GetRecordValue( 'subtitle', $record,
67
              GetRecordValue( 'subtitle', $record,
68
                GetFrameworkCode( $_->{biblionumber} ) );
68
                GetFrameworkCode( $_->{biblionumber} ) );
(-)a/tools/batch_delete_records.pl (-1 / +1 lines)
Lines 80-86 if ( $op eq 'form' ) { Link Here
80
            }
80
            }
81
            my $holds_count = $biblio->holds->count;
81
            my $holds_count = $biblio->holds->count;
82
            $biblio = $biblio->unblessed;
82
            $biblio = $biblio->unblessed;
83
            my $record = &GetMarcBiblio( $record_id );
83
            my $record = &GetMarcBiblio({ biblionumber => $record_id });
84
            $biblio->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $record_id ) );
84
            $biblio->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $record_id ) );
85
            $biblio->{itemnumbers} = C4::Items::GetItemnumbersForBiblio( $record_id );
85
            $biblio->{itemnumbers} = C4::Items::GetItemnumbersForBiblio( $record_id );
86
            $biblio->{holds_count} = $holds_count;
86
            $biblio->{holds_count} = $holds_count;
(-)a/tools/batch_record_modification.pl (-1 / +1 lines)
Lines 191-197 if ( $op eq 'form' ) { Link Here
191
191
192
            # Finally, modify the biblio
192
            # Finally, modify the biblio
193
            my $error = eval {
193
            my $error = eval {
194
                my $record = GetMarcBiblio( $biblionumber );
194
                my $record = GetMarcBiblio({ biblionumber => $biblionumber });
195
                ModifyRecordWithTemplate( $mmtid, $record );
195
                ModifyRecordWithTemplate( $mmtid, $record );
196
                my $frameworkcode = C4::Biblio::GetFrameworkCode( $biblionumber );
196
                my $frameworkcode = C4::Biblio::GetFrameworkCode( $biblionumber );
197
                ModBiblio( $record, $biblionumber, $frameworkcode );
197
                ModBiblio( $record, $biblionumber, $frameworkcode );
(-)a/tools/showdiffmarc.pl (-1 / +3 lines)
Lines 59-65 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
59
    }
59
    }
60
);
60
);
61
61
62
$recordBiblionumber = GetMarcBiblio($biblionumber, 'embed_items');
62
$recordBiblionumber = GetMarcBiblio({
63
    biblionumber => $biblionumber,
64
    embed_items  => 'embed_items' });
63
if( $recordBiblionumber ) {
65
if( $recordBiblionumber ) {
64
    $formatted1 = $recordBiblionumber->as_formatted;
66
    $formatted1 = $recordBiblionumber->as_formatted;
65
    my $biblio = Koha::Biblios->find( $biblionumber );
67
    my $biblio = Koha::Biblios->find( $biblionumber );
(-)a/virtualshelves/downloadshelf.pl (-1 / +3 lines)
Lines 71-77 if ($shelfid && $format) { Link Here
71
            else { #Other formats
71
            else { #Other formats
72
                while ( my $content = $contents->next ) {
72
                while ( my $content = $contents->next ) {
73
                    my $biblionumber = $content->biblionumber;
73
                    my $biblionumber = $content->biblionumber;
74
                    my $record = GetMarcBiblio($biblionumber, 1);
74
                    my $record = GetMarcBiblio({
75
                        biblionumber => $biblionumber,
76
                        embed_items  => 1 });
75
                    if ($format eq 'iso2709') {
77
                    if ($format eq 'iso2709') {
76
                        $output .= $record->as_usmarc();
78
                        $output .= $record->as_usmarc();
77
                    }
79
                    }
(-)a/virtualshelves/sendshelf.pl (-1 / +3 lines)
Lines 80-86 if ($email) { Link Here
80
        my $biblionumber     = $content->biblionumber;
80
        my $biblionumber     = $content->biblionumber;
81
        my $fw               = GetFrameworkCode($biblionumber);
81
        my $fw               = GetFrameworkCode($biblionumber);
82
        my $dat              = GetBiblioData($biblionumber);
82
        my $dat              = GetBiblioData($biblionumber);
83
        my $record           = GetMarcBiblio($biblionumber, 1);
83
        my $record           = GetMarcBiblio({
84
            biblionumber => $biblionumber,
85
            embed_items  => 1 });
84
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
86
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
85
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
87
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
86
        my $subtitle         = GetRecordValue( 'subtitle', $record, $fw );
88
        my $subtitle         = GetRecordValue( 'subtitle', $record, $fw );
(-)a/virtualshelves/shelves.pl (-2 / +1 lines)
Lines 237-243 if ( $op eq 'view' ) { Link Here
237
            while ( my $content = $contents->next ) {
237
            while ( my $content = $contents->next ) {
238
                my $this_item;
238
                my $this_item;
239
                my $biblionumber = $content->biblionumber;
239
                my $biblionumber = $content->biblionumber;
240
                my $record       = GetMarcBiblio($biblionumber);
240
                my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
241
241
242
                if ( $xslfile ) {
242
                if ( $xslfile ) {
243
                    $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTListsDisplay",
243
                    $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTListsDisplay",
244
- 

Return to bug 19040