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

(-)a/C4/AuthoritiesMarc.pm (+1 lines)
Lines 1475-1480 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
        print STDERR "C4/AuthoritiesMarc: 1\n";
1478
        my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
1479
        my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
1479
        next if !$marcrecord;
1480
        next if !$marcrecord;
1480
        my $update = 0;
1481
        my $update = 0;
(-)a/C4/Biblio.pm (+7 lines)
Lines 293-298 sub ModBiblio { Link Here
293
    }
293
    }
294
294
295
    if ( C4::Context->preference("CataloguingLog") ) {
295
    if ( C4::Context->preference("CataloguingLog") ) {
296
        print STDERR "C4/Biblio: 1\n";
296
        my $newrecord = GetMarcBiblio({ biblionumber => $biblionumber });
297
        my $newrecord = GetMarcBiblio({ biblionumber => $biblionumber });
297
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $newrecord->as_formatted );
298
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $newrecord->as_formatted );
298
    }
299
    }
Lines 1170-1180 OpacHiddenItems to be applied. Link Here
1170
sub GetMarcBiblio {
1171
sub GetMarcBiblio {
1171
    my ($params) = @_;
1172
    my ($params) = @_;
1172
1173
1174
    print STDERR "C4/Biblio: 2\n";
1173
    if (not defined $params) {
1175
    if (not defined $params) {
1174
        carp 'GetMarcBiblio called without parameters';
1176
        carp 'GetMarcBiblio called without parameters';
1175
        return;
1177
        return;
1176
    }
1178
    }
1177
1179
1180
    print STDERR "C4/Biblio: 3\n";
1178
    my $biblionumber = $params->{biblionumber};
1181
    my $biblionumber = $params->{biblionumber};
1179
    my $embeditems   = $params->{embed_items} || 0;
1182
    my $embeditems   = $params->{embed_items} || 0;
1180
    my $opac         = $params->{opac} || 0;
1183
    my $opac         = $params->{opac} || 0;
Lines 2194-2199 sub PrepHostMarcField { Link Here
2194
    my ($hostbiblionumber,$hostitemnumber, $marcflavour) = @_;
2197
    my ($hostbiblionumber,$hostitemnumber, $marcflavour) = @_;
2195
    $marcflavour ||="MARC21";
2198
    $marcflavour ||="MARC21";
2196
    
2199
    
2200
    print STDERR "C4/Biblio: 4\n";
2197
    require C4::Items;
2201
    require C4::Items;
2198
    my $hostrecord = GetMarcBiblio({ biblionumber => $hostbiblionumber });
2202
    my $hostrecord = GetMarcBiblio({ biblionumber => $hostbiblionumber });
2199
	my $item = C4::Items::GetItem($hostitemnumber);
2203
	my $item = C4::Items::GetItem($hostitemnumber);
Lines 2844-2849 sub ModZebra { Link Here
2844
        );
2848
        );
2845
        if ( $op eq 'specialUpdate' ) {
2849
        if ( $op eq 'specialUpdate' ) {
2846
            unless ($record) {
2850
            unless ($record) {
2851
    print STDERR "C4/Biblio: 5\n";
2847
                $record = GetMarcBiblio({
2852
                $record = GetMarcBiblio({
2848
                    biblionumber => $biblionumber,
2853
                    biblionumber => $biblionumber,
2849
                    embed_items  => 1 });
2854
                    embed_items  => 1 });
Lines 3459-3464 Generate the host item entry for an analytic child entry Link Here
3459
sub prepare_host_field {
3464
sub prepare_host_field {
3460
    my ( $hostbiblio, $marcflavour ) = @_;
3465
    my ( $hostbiblio, $marcflavour ) = @_;
3461
    $marcflavour ||= C4::Context->preference('marcflavour');
3466
    $marcflavour ||= C4::Context->preference('marcflavour');
3467
    print STDERR "C4/Biblio: 6\n";
3462
    my $host = GetMarcBiblio({ biblionumber => $hostbiblio });
3468
    my $host = GetMarcBiblio({ biblionumber => $hostbiblio });
3463
    # unfortunately as_string does not 'do the right thing'
3469
    # unfortunately as_string does not 'do the right thing'
3464
    # if field returns undef
3470
    # if field returns undef
Lines 3597-3602 sub UpdateTotalIssues { Link Here
3597
    my ($biblionumber, $increase, $value) = @_;
3603
    my ($biblionumber, $increase, $value) = @_;
3598
    my $totalissues;
3604
    my $totalissues;
3599
3605
3606
    print STDERR "C4/Biblio: 7\n";
3600
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
3607
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
3601
    unless ($record) {
3608
    unless ($record) {
3602
        carp "UpdateTotalIssues could not get biblio record";
3609
        carp "UpdateTotalIssues could not get biblio record";
(-)a/C4/HoldsQueue.pm (+1 lines)
Lines 146-151 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
        print STDERR "C4/HoldsQueue: 1\n";
149
        my $record = GetMarcBiblio({ biblionumber => $row->{biblionumber} });
150
        my $record = GetMarcBiblio({ biblionumber => $row->{biblionumber} });
150
        if ($record){
151
        if ($record){
151
            $row->{subtitle} = [ map { $_->{subfield} } @{ GetRecordValue( 'subtitle', $record, '' ) } ];
152
            $row->{subtitle} = [ map { $_->{subfield} } @{ GetRecordValue( 'subtitle', $record, '' ) } ];
(-)a/C4/ILSDI/Services.pm (+1 lines)
Lines 214-219 sub GetRecords { Link Here
214
        }
214
        }
215
215
216
        my $embed_items = 1;
216
        my $embed_items = 1;
217
        print STDERR "C4/ILSDI/Services: 1\n";
217
        my $record = GetMarcBiblio({
218
        my $record = GetMarcBiblio({
218
            biblionumber => $biblionumber,
219
            biblionumber => $biblionumber,
219
            embed_items  => $embed_items });
220
            embed_items  => $embed_items });
(-)a/C4/Items.pm (+1 lines)
Lines 1321-1326 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
    print STDERR "C4/Items: 1\n";
1324
    my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
1325
    my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
1325
1326
1326
    return unless $marcrecord;
1327
    return unless $marcrecord;
(-)a/C4/Labels/Label.pm (+2 lines)
Lines 396-401 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
    print STDERR "C4/Labels/Label: 1\n";
399
    my $record = GetMarcBiblio({ biblionumber => $item->{'biblionumber'} });
400
    my $record = GetMarcBiblio({ biblionumber => $item->{'biblionumber'} });
400
    # FIXME - returns all items, so you can't get data from an embedded holdings field.
401
    # 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).
402
    # TODO - add a GetMarcBiblio1item(bibnum,itemnum) or a GetMarcItem(itemnum).
Lines 601-606 sub csv_data { Link Here
601
    my $self = shift;
602
    my $self = shift;
602
    my $label_fields = _get_text_fields($self->{'format_string'});
603
    my $label_fields = _get_text_fields($self->{'format_string'});
603
    my $item = _get_label_item($self->{'item_number'});
604
    my $item = _get_label_item($self->{'item_number'});
605
    print STDERR "C4/Labels/Label: 2\n";
604
    my $bib_record = GetMarcBiblio({ biblionumber => $item->{biblionumber} });
606
    my $bib_record = GetMarcBiblio({ biblionumber => $item->{biblionumber} });
605
    my @csv_data = (map { _get_barcode_data($_->{'code'},$item,$bib_record) } @$label_fields);
607
    my @csv_data = (map { _get_barcode_data($_->{'code'},$item,$bib_record) } @$label_fields);
606
    return \@csv_data;
608
    return \@csv_data;
(-)a/C4/Record.pm (+1 lines)
Lines 471-476 sub marcrecord2csv { Link Here
471
    my $output;
471
    my $output;
472
472
473
    # Getting the record
473
    # Getting the record
474
    print STDERR "C4/Record: 1\n";
474
    my $record = GetMarcBiblio({ biblionumber => $biblio });
475
    my $record = GetMarcBiblio({ biblionumber => $biblio });
475
    return unless $record;
476
    return unless $record;
476
    C4::Biblio::EmbedItemsInMarcBiblio( $record, $biblio, $itemnumbers );
477
    C4::Biblio::EmbedItemsInMarcBiblio( $record, $biblio, $itemnumbers );
(-)a/C4/Search.pm (+1 lines)
Lines 2008-2013 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
                print STDERR "C4/Search: 1\n";
2011
                my $hostbiblio = GetMarcBiblio({
2012
                my $hostbiblio = GetMarcBiblio({
2012
                    biblionumber => $hostbiblionumber,
2013
                    biblionumber => $hostbiblionumber,
2013
                    embed_items  => 1 });
2014
                    embed_items  => 1 });
(-)a/C4/Serials.pm (+1 lines)
Lines 1485-1490 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
        print STDERR "C4/Serials: 1\n";
1488
        my $record = GetMarcBiblio({ biblionumber => $biblionumber });
1489
        my $record = GetMarcBiblio({ biblionumber => $biblionumber });
1489
        my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial', $biblio->frameworkcode );
1490
        my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial', $biblio->frameworkcode );
1490
        if ($tag) {
1491
        if ($tag) {
(-)a/C4/ShelfBrowser.pm (+1 lines)
Lines 223-228 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
        print STDERR "C4/ShelfBrowser: 1\n";
226
        my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} });
227
        my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} });
227
        $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
228
        $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
228
        $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
229
        $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
(-)a/Koha/Biblio.pm (+1 lines)
Lines 58-63 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
    print STDERR "Koha/Biblio: 1\n";
61
    return map { $_->{subfield} } @{
62
    return map { $_->{subfield} } @{
62
        C4::Biblio::GetRecordValue(
63
        C4::Biblio::GetRecordValue(
63
            'subtitle',
64
            'subtitle',
(-)a/Koha/BiblioUtils.pm (+2 lines)
Lines 121-126 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
            print STDERR "Koha/BiblioUtils: 1\n";
124
            my $marc = C4::Biblio::GetMarcBiblio({
125
            my $marc = C4::Biblio::GetMarcBiblio({
125
                biblionumber => $row->biblionumber,
126
                biblionumber => $row->biblionumber,
126
                embed_items  => 1 });
127
                embed_items  => 1 });
Lines 160-165 If set to true, item data is embedded in the record. Default is to not do this. Link Here
160
sub get_marc_biblio {
161
sub get_marc_biblio {
161
    my ($class, $bibnum, %options) = @_;
162
    my ($class, $bibnum, %options) = @_;
162
163
164
    print STDERR "Koha/BiblioUtils: 2\n";
163
    return C4::Biblio::GetMarcBiblio({
165
    return C4::Biblio::GetMarcBiblio({
164
        biblionumber => $bibnum,
166
        biblionumber => $bibnum,
165
        embed_items  => ($options{item_data} ? 1 : 0 ) });
167
        embed_items  => ($options{item_data} ? 1 : 0 ) });
(-)a/Koha/Exporter/Record.pm (+1 lines)
Lines 65-70 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
    print STDERR "Koha/Exporter/Record: 1\n";
68
    my $record = eval { C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); };
69
    my $record = eval { C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); };
69
70
70
    return if $@ or not defined $record;
71
    return if $@ or not defined $record;
(-)a/Koha/OAI/Server/Repository.pm (+1 lines)
Lines 160-165 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
    print STDERR "Koha/OAI/Server/Repository: 1\n";
163
    my $record = GetMarcBiblio({
164
    my $record = GetMarcBiblio({
164
        biblionumber => $biblionumber,
165
        biblionumber => $biblionumber,
165
        embed_items  => $with_items,
166
        embed_items  => $with_items,
(-)a/basket/basket.pl (+1 lines)
Lines 63-68 foreach my $biblionumber ( @bibs ) { Link Here
63
63
64
    my $dat              = &GetBiblioData($biblionumber);
64
    my $dat              = &GetBiblioData($biblionumber);
65
    next unless $dat;
65
    next unless $dat;
66
    print STDERR "basket/basket: 1\n";
66
    my $record           = &GetMarcBiblio({ biblionumber => $biblionumber });
67
    my $record           = &GetMarcBiblio({ biblionumber => $biblionumber });
67
    my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
68
    my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
68
    my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
69
    my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
(-)a/basket/downloadcart.pl (+1 lines)
Lines 65-70 if ($bib_list && $format) { Link Here
65
65
66
        foreach my $biblio (@bibs) {
66
        foreach my $biblio (@bibs) {
67
67
68
            print STDERR "basket/downloadcart: 1\n";
68
            my $record = GetMarcBiblio({
69
            my $record = GetMarcBiblio({
69
                biblionumber => $biblio,
70
                biblionumber => $biblio,
70
                embed_items  => 1 });
71
                embed_items  => 1 });
(-)a/basket/sendbasket.pl (+1 lines)
Lines 73-78 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
        print STDERR "basket/sendcart: 1\n";
76
        my $record           = GetMarcBiblio({
77
        my $record           = GetMarcBiblio({
77
            biblionumber => $biblionumber,
78
            biblionumber => $biblionumber,
78
            embed_items => 1 });
79
            embed_items => 1 });
(-)a/catalogue/ISBDdetail.pl (+1 lines)
Lines 78-83 if ( not defined $biblionumber ) { Link Here
78
       exit;
78
       exit;
79
}
79
}
80
80
81
print STDERR "catalogue/ISBDdetail: 1\n";
81
my $record = GetMarcBiblio({
82
my $record = GetMarcBiblio({
82
    biblionumber => $biblionumber,
83
    biblionumber => $biblionumber,
83
    embed_items  => 1 });
84
    embed_items  => 1 });
(-)a/catalogue/MARCdetail.pl (+1 lines)
Lines 88-93 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
88
    }
88
    }
89
);
89
);
90
90
91
print STDERR "catalogue/MARCdetail: 1\n";
91
my $record = GetMarcBiblio({
92
my $record = GetMarcBiblio({
92
    biblionumber => $biblionumber,
93
    biblionumber => $biblionumber,
93
    embed_items  => 1 });
94
    embed_items  => 1 });
(-)a/catalogue/detail.pl (+1 lines)
Lines 63-68 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
print STDERR "catalogue/detail: 1\n";
66
my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
67
my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
67
68
68
if ( not defined $record ) {
69
if ( not defined $record ) {
(-)a/catalogue/export.pl (+1 lines)
Lines 28-33 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
            print STDERR "catalogue/export: 1\n";
31
            my $marc = GetMarcBiblio({
32
            my $marc = GetMarcBiblio({
32
                biblionumber => $biblionumber,
33
                biblionumber => $biblionumber,
33
                embed_items  => 1 });
34
                embed_items  => 1 });
(-)a/catalogue/labeledMARCdetail.pl (+1 lines)
Lines 56-61 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
56
    }
56
    }
57
);
57
);
58
58
59
print STDERR "catalogue/labeledMARCdetail: 1\n";
59
my $record = GetMarcBiblio({ biblionumber => $biblionumber });
60
my $record = GetMarcBiblio({ biblionumber => $biblionumber });
60
if ( not defined $record ) {
61
if ( not defined $record ) {
61
    # biblionumber invalid -> report and exit
62
    # biblionumber invalid -> report and exit
(-)a/catalogue/moredetail.pl (+1 lines)
Lines 100-105 for my $itm (@all_items) { Link Here
100
                               ($itemnumber != $itm->{itemnumber}));
100
                               ($itemnumber != $itm->{itemnumber}));
101
}
101
}
102
102
103
print "catalogue/moredetail: 1\n";
103
my $record=GetMarcBiblio({ biblionumber => $biblionumber });
104
my $record=GetMarcBiblio({ biblionumber => $biblionumber });
104
105
105
my $hostrecords;
106
my $hostrecords;
(-)a/catalogue/showmarc.pl (+1 lines)
Lines 46-51 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
    print STDERR "catalogue/showmarc: 1\n";
49
    $record =GetMarcBiblio({ biblionumber => $biblionumber });
50
    $record =GetMarcBiblio({ biblionumber => $biblionumber });
50
}
51
}
51
if(!ref $record) {
52
if(!ref $record) {
(-)a/cataloguing/addbiblio.pl (+1 lines)
Lines 770-775 my ( Link Here
770
);
770
);
771
771
772
if (($biblionumber) && !($breedingid)){
772
if (($biblionumber) && !($breedingid)){
773
    print STDERR "cataloguing/addbiblio: 1\n";
773
    $record = GetMarcBiblio({ biblionumber => $biblionumber });
774
    $record = GetMarcBiblio({ biblionumber => $biblionumber });
774
}
775
}
775
if ($breedingid) {
776
if ($breedingid) {
(-)a/cataloguing/additem.pl (+3 lines)
Lines 411-416 $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
print STDERR "cataloguing/additem: 1\n";
414
my $record = GetMarcBiblio({ biblionumber => $biblionumber });
415
my $record = GetMarcBiblio({ biblionumber => $biblionumber });
415
my $oldrecord = TransformMarcToKoha($record);
416
my $oldrecord = TransformMarcToKoha($record);
416
my $itemrecord;
417
my $itemrecord;
Lines 724-729 if ($op eq "additem") { Link Here
724
#-------------------------------------------------------------------------------
725
#-------------------------------------------------------------------------------
725
726
726
# now, build existiing item list
727
# now, build existiing item list
728
print STDERR "cataloguing/additem: 2\n";
727
my $temp = GetMarcBiblio({ biblionumber => $biblionumber });
729
my $temp = GetMarcBiblio({ biblionumber => $biblionumber });
728
#my @fields = $record->fields();
730
#my @fields = $record->fields();
729
731
Lines 748-753 if ( C4::Context->preference('EasyAnalyticalRecords') ) { Link Here
748
    foreach my $hostfield ($temp->field($analyticfield)){
750
    foreach my $hostfield ($temp->field($analyticfield)){
749
        my $hostbiblionumber = $hostfield->subfield('0');
751
        my $hostbiblionumber = $hostfield->subfield('0');
750
        if ($hostbiblionumber){
752
        if ($hostbiblionumber){
753
print STDERR "cataloguing/additem: 3\n";
751
            my $hostrecord = GetMarcBiblio({
754
            my $hostrecord = GetMarcBiblio({
752
                biblionumber => $hostbiblionumber,
755
                biblionumber => $hostbiblionumber,
753
                embed_items  => 1 });
756
                embed_items  => 1 });
(-)a/cataloguing/linkitem.pl (+1 lines)
Lines 45-50 my ($template, $loggedinuser, $cookie) = get_template_and_user( Link Here
45
    }
45
    }
46
);
46
);
47
47
48
print STDERR "cataloguing/linkitem: 1\n";
48
my $biblio = GetMarcBiblio({ biblionumber => $biblionumber });
49
my $biblio = GetMarcBiblio({ biblionumber => $biblionumber });
49
my $marcflavour = C4::Context->preference("marcflavour");
50
my $marcflavour = C4::Context->preference("marcflavour");
50
$marcflavour ||="MARC21";
51
$marcflavour ||="MARC21";
(-)a/cataloguing/merge.pl (+3 lines)
Lines 78-83 if ($merge) { Link Here
78
    }
78
    }
79
79
80
    # Rewriting the leader
80
    # Rewriting the leader
81
    print STDERR "cataloguing/merge: 1\n";
81
    $record->leader(GetMarcBiblio({ biblionumber => $ref_biblionumber })->leader());
82
    $record->leader(GetMarcBiblio({ biblionumber => $ref_biblionumber })->leader());
82
83
83
    my $frameworkcode = $input->param('frameworkcode');
84
    my $frameworkcode = $input->param('frameworkcode');
Lines 115-120 if ($merge) { Link Here
115
    my $report_header = {};
116
    my $report_header = {};
116
    foreach my $biblionumber ($ref_biblionumber, @biblionumbers) {
117
    foreach my $biblionumber ($ref_biblionumber, @biblionumbers) {
117
        # build report
118
        # build report
119
print STDERR "cataloguing/merge: 2\n";
118
        my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
120
        my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
119
        my %report_record = (
121
        my %report_record = (
120
            biblionumber => $biblionumber,
122
            biblionumber => $biblionumber,
Lines 202-207 if ($merge) { Link Here
202
        # Creating a loop for display
204
        # Creating a loop for display
203
        my @records;
205
        my @records;
204
        foreach my $biblionumber (@biblionumbers) {
206
        foreach my $biblionumber (@biblionumbers) {
207
print STDERR "cataloguing/merge: 3\n";
205
            my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
208
            my $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
206
            my $frameworkcode = GetFrameworkCode($biblionumber);
209
            my $frameworkcode = GetFrameworkCode($biblionumber);
207
            my $recordObj = new Koha::MetadataRecord({'record' => $marcrecord, schema => $marcflavour});
210
            my $recordObj = new Koha::MetadataRecord({'record' => $marcrecord, schema => $marcflavour});
(-)a/cataloguing/value_builder/marc21_linking_section.pl (+1 lines)
Lines 85-90 my $launcher = sub { Link Here
85
        );
85
        );
86
86
87
        #get marc record
87
        #get marc record
88
        print STDERR "cataloguing/value_builder/marc21_linking_section: 1\n";
88
        $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
89
        $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
89
90
90
        my $subfield_value_9 = $biblionumber;
91
        my $subfield_value_9 = $biblionumber;
(-)a/cataloguing/value_builder/unimarc_field_4XX.pl (+1 lines)
Lines 96-101 sub plugin { Link Here
96
        );
96
        );
97
97
98
        #get marc record
98
        #get marc record
99
        print STDERR "cataloguing/value_builder/unimarc_field_4XX: 1\n";
99
        $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
100
        $marcrecord = GetMarcBiblio({ biblionumber => $biblionumber });
100
101
101
        my $subfield_value_9 = $biblionumber;
102
        my $subfield_value_9 = $biblionumber;
(-)a/circ/branchoverdues.pl (+1 lines)
Lines 110-115 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
    print STDERR "circ/branchoverdues: 1\n";
113
    my $record = GetMarcBiblio({ biblionumber => $num->{biblionumber} });
114
    my $record = GetMarcBiblio({ biblionumber => $num->{biblionumber} });
114
    if ($record){
115
    if ($record){
115
        $overdueforbranch{'subtitle'} = GetRecordValue('subtitle',$record,'')->[0]->{subfield};
116
        $overdueforbranch{'subtitle'} = GetRecordValue('subtitle',$record,'')->[0]->{subfield};
(-)a/circ/reserveratios.pl (+1 lines)
Lines 144-149 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
    print STDERR "circ/reserveratios: 1\n";
147
    my $record = GetMarcBiblio({ biblionumber => $data->{biblionumber} });
148
    my $record = GetMarcBiblio({ biblionumber => $data->{biblionumber} });
148
    $data->{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($data->{biblionumber}));
149
    $data->{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($data->{biblionumber}));
149
    push(
150
    push(
(-)a/circ/transferstoreceive.pl (+1 lines)
Lines 109-114 while ( my $library = $libraries->next ) { Link Here
109
                itemcallnumber => $item->itemcallnumber,
109
                itemcallnumber => $item->itemcallnumber,
110
            );
110
            );
111
111
112
            print STDERR "circ/transferstoreceive: 1\n";
112
            my $record = GetMarcBiblio({ biblionumber => $biblio->biblionumber });
113
            my $record = GetMarcBiblio({ biblionumber => $biblio->biblionumber });
113
            $getransf{'subtitle'} = GetRecordValue('subtitle', $record, $biblio->frameworkcode);
114
            $getransf{'subtitle'} = GetRecordValue('subtitle', $record, $biblio->frameworkcode);
114
115
(-)a/circ/waitingreserves.pl (+1 lines)
Lines 113-118 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
    print STDERR "circ/waitingreserves: 1\n";
116
    $getreserv{'subtitle'}       = GetRecordValue(
117
    $getreserv{'subtitle'}       = GetRecordValue(
117
        'subtitle',
118
        'subtitle',
118
        GetMarcBiblio({ biblionumber => $biblio->biblionumber }),
119
        GetMarcBiblio({ biblionumber => $biblio->biblionumber }),
(-)a/misc/batchRebuildBiblioTables.pl (+1 lines)
Lines 61-66 $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
    print STDERR "misc/batchRebuildBiblioTables: 1\n";
64
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
65
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
65
    if (not defined $record) {
66
    if (not defined $record) {
66
	push @errors, $biblionumber;
67
	push @errors, $biblionumber;
(-)a/misc/batchRebuildItemsTables.pl (+1 lines)
Lines 68-73 $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
    print STDERR "misc/batchRebuildItemsTables: 1\n";
71
    my $record = GetMarcBiblio({
72
    my $record = GetMarcBiblio({
72
        biblionummber => $biblionumber,
73
        biblionummber => $biblionumber,
73
        embed_items   => 1 });
74
        embed_items   => 1 });
(-)a/misc/batchRepairMissingBiblionumbers.pl (+1 lines)
Lines 24-29 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
    print STDERR "misc/batchRepairMissingBiblionumbers: 1\n";
27
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
28
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
28
    C4::Biblio::_koha_marc_update_bib_ids($record, $frameworkcode, $biblionumber, $biblioitemnumber);
29
    C4::Biblio::_koha_marc_update_bib_ids($record, $frameworkcode, $biblionumber, $biblioitemnumber);
29
    my $biblionumber = eval {ModBiblioMarc( $record, $biblionumber, $frameworkcode )};
30
    my $biblionumber = eval {ModBiblioMarc( $record, $biblionumber, $frameworkcode )};
(-)a/misc/cronjobs/build_browser_and_cloud.pl (+1 lines)
Lines 91-96 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
        print STDERR "misc/cronjobs/build_browser_and_cloud: 1\n";
94
        $Koharecord = GetMarcBiblio({ biblionumber => $biblionumber });
95
        $Koharecord = GetMarcBiblio({ biblionumber => $biblionumber });
95
    };
96
    };
96
    if($@){
97
    if($@){
(-)a/misc/cronjobs/check-url-quick.pl (+1 lines)
Lines 90-95 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
                print STDERR "misc/cronjobs/check-url-quick: 1\n";
93
                my $record = GetMarcBiblio({ biblionumber => $biblionumber });
94
                my $record = GetMarcBiblio({ biblionumber => $biblionumber });
94
                for my $tag (@tags) {
95
                for my $tag (@tags) {
95
                    foreach my $field ( $record->field($tag) ) {
96
                    foreach my $field ( $record->field($tag) ) {
(-)a/misc/cronjobs/check-url.pl (+1 lines)
Lines 105-110 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
    print STDERR "misc/cronjobs/check-url: 1\n";
108
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
109
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
109
    return unless $record->field('856');
110
    return unless $record->field('856');
110
111
(-)a/misc/link_bibs_to_authorities.pl (+1 lines)
Lines 187-192 sub process_bib { Link Here
187
    my $linker       = shift;
187
    my $linker       = shift;
188
    my $biblionumber = shift;
188
    my $biblionumber = shift;
189
189
190
    print STDERR "misc/link_bibs_to_authorities: 1\n";
190
    my $bib = GetMarcBiblio({ biblionumber => $biblionumber });
191
    my $bib = GetMarcBiblio({ biblionumber => $biblionumber });
191
    unless ( defined $bib ) {
192
    unless ( defined $bib ) {
192
        print
193
        print
(-)a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl (+1 lines)
Lines 87-92 my $sth_prepared; Link Here
87
87
88
sub updateMarc {
88
sub updateMarc {
89
    my $id     = shift;
89
    my $id     = shift;
90
    print STDERR "misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio: 1\n";
90
    my $biblio = GetMarcBiblio({ biblionumber => $id });
91
    my $biblio = GetMarcBiblio({ biblionumber => $id });
91
92
92
    unless ($biblio) {
93
    unless ($biblio) {
(-)a/misc/maintenance/process_record_through_filter.pl (+1 lines)
Lines 10-15 use Koha::RecordProcessor; Link Here
10
use Data::Dumper;
10
use Data::Dumper;
11
use C4::Biblio;
11
use C4::Biblio;
12
12
13
print STDERR "misc/maintenance/process_record_through_filter: 1\n";
13
my $record = GetMarcBiblio({ biblionumber => $ARGV[0] });
14
my $record = GetMarcBiblio({ biblionumber => $ARGV[0] });
14
15
15
print "Before: " . $record->as_formatted() . "\n";
16
print "Before: " . $record->as_formatted() . "\n";
(-)a/misc/maintenance/remove_items_from_biblioitems.pl (+1 lines)
Lines 49-54 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
    print STDERR "misc/maintenance/remove_items_from_biblioitems: 1\n";
52
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
53
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
53
    
54
    
54
    if ($record) {
55
    if ($record) {
(-)a/misc/maintenance/sanitize_records.pl (+1 lines)
Lines 108-113 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
    print STDERR "misc/maintenance/sanitize_records: 1\n";
111
    my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
112
    my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
112
    unless ($record) {
113
    unless ($record) {
113
        say " skipping. ERROR: Invalid record." if $verbose;
114
        say " skipping. ERROR: Invalid record." if $verbose;
(-)a/misc/maintenance/touch_all_biblios.pl (+1 lines)
Lines 78-83 $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
  print STDERR "misc/maintenance/touch_all_biblios: 1\n";
81
  my $record = GetMarcBiblio({ biblionumber => $biblionumber });
82
  my $record = GetMarcBiblio({ biblionumber => $biblionumber });
82
 
83
 
83
  my $modok = ModBiblio($record, $biblionumber, $frameworkcode);
84
  my $modok = ModBiblio($record, $biblionumber, $frameworkcode);
(-)a/misc/migration_tools/buildEDITORS.pl (+1 lines)
Lines 70-75 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
    print STDERR "misc/migration_tools/buildEDITORS: 1\n";
73
    my $record = GetMarcBiblio({ biblionumber => $bibid });
74
    my $record = GetMarcBiblio({ biblionumber => $bibid });
74
	my $isbnField = $record->field('010');
75
	my $isbnField = $record->field('010');
75
	next unless $isbnField;
76
	next unless $isbnField;
(-)a/misc/migration_tools/create_analytical_rel.pl (+1 lines)
Lines 81-86 _SUMMARY_ Link Here
81
sub process_bib {
81
sub process_bib {
82
    my $biblionumber = shift;
82
    my $biblionumber = shift;
83
83
84
    print STDERR "misc/migration_tools/create_analytical_rel: 1\n";
84
    my $bib = GetMarcBiblio({ biblionumber => $biblionumber });
85
    my $bib = GetMarcBiblio({ biblionumber => $biblionumber });
85
    unless (defined $bib) {
86
    unless (defined $bib) {
86
        print "\nCould not retrieve bib $biblionumber from the database - record is corrupt.\n";
87
        print "\nCould not retrieve bib $biblionumber from the database - record is corrupt.\n";
(-)a/misc/migration_tools/import_lexile.pl (+1 lines)
Lines 152-157 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
        print STDERR "misc/migration_tools/import_lexile: 1\n";
155
        my $record = GetMarcBiblio({ biblionumber => $biblionumber });
156
        my $record = GetMarcBiblio({ biblionumber => $biblionumber });
156
157
157
        if ($verbose) {
158
        if ($verbose) {
(-)a/misc/migration_tools/rebuild_zebra.pl (+1 lines)
Lines 675-680 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
        print STDERR "misc/migration_tools/rebuild_index: 1\n";
678
        eval { $marc = GetMarcBiblio({ biblionumber => $record_number, embed_items => 1 }); };
679
        eval { $marc = GetMarcBiblio({ biblionumber => $record_number, embed_items => 1 }); };
679
        if ($@ || !$marc) {
680
        if ($@ || !$marc) {
680
            # here we do warn since catching an exception
681
            # here we do warn since catching an exception
(-)a/misc/migration_tools/switch_marc21_series_info.pl (+1 lines)
Lines 139-144 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
    print STDERR "misc/migration_tools/switch_marc21_series_info: 1\n";
142
    my $biblio = GetMarcBiblio({ biblionumber => $biblionumber });
143
    my $biblio = GetMarcBiblio({ biblionumber => $biblionumber });
143
144
144
    foreach my $field ( $biblio->field( '440' ) ) {
145
    foreach my $field ( $biblio->field( '440' ) ) {
(-)a/misc/migration_tools/upgradeitems.pl (+1 lines)
Lines 18-23 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
    print STDERR "misc/migration_tools/upgradeitems: 1\n";
21
    my $record=GetMarcBiblio({ biblionumber => $biblionumber });
22
    my $record=GetMarcBiblio({ biblionumber => $biblionumber });
22
    foreach my $itemfield ($record->field('995')){
23
    foreach my $itemfield ($record->field('995')){
23
        my $marcitem=MARC::Record->new();
24
        my $marcitem=MARC::Record->new();
(-)a/opac/opac-ISBDdetail.pl (+1 lines)
Lines 93-98 if (scalar @items >= 1) { Link Here
93
    }
93
    }
94
}
94
}
95
95
96
print STDERR "opac/opac-ISBDdetail: 1\n";
96
my $record = GetMarcBiblio({
97
my $record = GetMarcBiblio({
97
    biblionumber => $biblionumber,
98
    biblionumber => $biblionumber,
98
    embed_items  => 1 });
99
    embed_items  => 1 });
(-)a/opac/opac-MARCdetail.pl (+1 lines)
Lines 71-76 if ( ! $biblionumber ) { Link Here
71
    exit;
71
    exit;
72
}
72
}
73
73
74
print STDERR "opac/opac-MARCdetail: 1\n";
74
my $record = GetMarcBiblio({
75
my $record = GetMarcBiblio({
75
    biblionumber => $biblionumber,
76
    biblionumber => $biblionumber,
76
    embed_items  => 1 });
77
    embed_items  => 1 });
(-)a/opac/opac-basket.pl (+1 lines)
Lines 65-70 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
    print STDERR "opac/opac-basket: 1\n";
68
    my $record = &GetMarcBiblio({ biblionumber => $biblionumber });
69
    my $record = &GetMarcBiblio({ biblionumber => $biblionumber });
69
    my $framework = &GetFrameworkCode( $biblionumber );
70
    my $framework = &GetFrameworkCode( $biblionumber );
70
    $record_processor->options({
71
    $record_processor->options({
(-)a/opac/opac-detail.pl (+1 lines)
Lines 90-95 if (scalar @all_items >= 1) { Link Here
90
    }
90
    }
91
}
91
}
92
92
93
print STDERR "opac/opac-detail: 1\n";
93
my $record = GetMarcBiblio({ biblionumber => $biblionumber });
94
my $record = GetMarcBiblio({ biblionumber => $biblionumber });
94
if ( ! $record ) {
95
if ( ! $record ) {
95
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
96
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
(-)a/opac/opac-downloadcart.pl (+1 lines)
Lines 68-73 if ($bib_list && $format) { Link Here
68
        });
68
        });
69
        foreach my $biblio (@bibs) {
69
        foreach my $biblio (@bibs) {
70
70
71
            print STDERR "opac/opac-downloadcart: 1\n";
71
            my $record = GetMarcBiblio({
72
            my $record = GetMarcBiblio({
72
                biblionumber => $biblio,
73
                biblionumber => $biblio,
73
                embed_items  => 1 });
74
                embed_items  => 1 });
(-)a/opac/opac-downloadshelf.pl (+1 lines)
Lines 81-86 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
                print STDERR "opac/opac-downloadshelf: 1\n";
84
                my $record = GetMarcBiblio({
85
                my $record = GetMarcBiblio({
85
                    biblionumber => $biblionumber,
86
                    biblionumber => $biblionumber,
86
                    embed_items  => 1 });
87
                    embed_items  => 1 });
(-)a/opac/opac-export.pl (+1 lines)
Lines 36-41 $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
print STDERR "opac/opac-export: 1\n";
39
my $marc = $biblionumber
40
my $marc = $biblionumber
40
    ? GetMarcBiblio({
41
    ? GetMarcBiblio({
41
        biblionumber => $biblionumber,
42
        biblionumber => $biblionumber,
(-)a/opac/opac-reserve.pl (+2 lines)
Lines 159-164 foreach my $biblioNumber (@biblionumbers) { Link Here
159
159
160
    my @itemInfos = GetItemsInfo($biblioNumber);
160
    my @itemInfos = GetItemsInfo($biblioNumber);
161
161
162
    print STDERR "opac/opac-reserve: 1\n";
162
    my $marcrecord= GetMarcBiblio({ biblionumber => $biblioNumber });
163
    my $marcrecord= GetMarcBiblio({ biblionumber => $biblioNumber });
163
164
164
    # flag indicating existence of at least one item linked via a host record
165
    # flag indicating existence of at least one item linked via a host record
Lines 401-406 $template->param('item_level_itypes' => $itemLevelTypes); Link Here
401
foreach my $biblioNum (@biblionumbers) {
402
foreach my $biblioNum (@biblionumbers) {
402
403
403
    my @not_available_at = ();
404
    my @not_available_at = ();
405
print STDERR "opac/opac-reserve: 2\n";
404
    my $record = GetMarcBiblio({ biblionumber => $biblioNum });
406
    my $record = GetMarcBiblio({ biblionumber => $biblioNum });
405
    # Init the bib item with the choices for branch pickup
407
    # Init the bib item with the choices for branch pickup
406
    my %biblioLoopIter;
408
    my %biblioLoopIter;
(-)a/opac/opac-search.pl (+1 lines)
Lines 659-664 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
                print STDERR "opac/opac-search: 1\n";
662
                my $record = GetMarcBiblio({ biblionumber => $res->{'biblionumber'} });
663
                my $record = GetMarcBiblio({ biblionumber => $res->{'biblionumber'} });
663
                $res->{coins} = GetCOinSBiblio($record);
664
                $res->{coins} = GetCOinSBiblio($record);
664
            }
665
            }
(-)a/opac/opac-sendbasket.pl (+1 lines)
Lines 87-92 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
        print STDERR "opac/opac-sendbasket: 1\n";
90
        my $record           = GetMarcBiblio({
91
        my $record           = GetMarcBiblio({
91
            biblionumber => $biblionumber,
92
            biblionumber => $biblionumber,
92
            embed_items  => 1 });
93
            embed_items  => 1 });
(-)a/opac/opac-sendshelf.pl (+1 lines)
Lines 90-95 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
        print STDERR "opac/opac-sendshelf: 1\n";
93
        my $record           = GetMarcBiblio({
94
        my $record           = GetMarcBiblio({
94
            biblionumber => $biblionumber,
95
            biblionumber => $biblionumber,
95
            embed_items  => 1 });
96
            embed_items  => 1 });
(-)a/opac/opac-shelves.pl (+1 lines)
Lines 270-275 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
                print STDERR "opac/opac-shelves: 1\n";
273
                my $record = GetMarcBiblio({ biblionumber => $biblionumber });
274
                my $record = GetMarcBiblio({ biblionumber => $biblionumber });
274
                my $framework = GetFrameworkCode( $biblionumber );
275
                my $framework = GetFrameworkCode( $biblionumber );
275
                $record_processor->options({
276
                $record_processor->options({
(-)a/opac/opac-showmarc.pl (+1 lines)
Lines 47-52 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
    print STDERR "opac/opac-showmarc: 1\n";
50
    $record = GetMarcBiblio({ biblionumber => $biblionumber });
51
    $record = GetMarcBiblio({ biblionumber => $biblionumber });
51
    my $framework = GetFrameworkCode($biblionumber);
52
    my $framework = GetFrameworkCode($biblionumber);
52
    $record_processor->options({
53
    $record_processor->options({
(-)a/opac/opac-showreviews.pl (+1 lines)
Lines 91-96 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
    print STDERR "opac/opac-showreviews: 1\n";
94
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
95
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
95
    my $frameworkcode = GetFrameworkCode($biblionumber);
96
    my $frameworkcode = GetFrameworkCode($biblionumber);
96
    my $borr = Koha::Patrons->find( $result->{borrowernumber} )->unblessed;
97
    my $borr = Koha::Patrons->find( $result->{borrowernumber} )->unblessed;
(-)a/opac/opac-tags.pl (+1 lines)
Lines 232-237 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
        print STDERR "opac/opac-tags: 1\n";
235
        my $record = &GetMarcBiblio({ biblionumber => $tag->{biblionumber} });
236
        my $record = &GetMarcBiblio({ biblionumber => $tag->{biblionumber} });
236
        $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) );
237
        $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) );
237
        $tag->{title} = $biblio->title;
238
        $tag->{title} = $biblio->title;
(-)a/opac/opac-user.pl (+1 lines)
Lines 204-209 if ($issues){ Link Here
204
        }
204
        }
205
        $issue->{'charges'} = $charges;
205
        $issue->{'charges'} = $charges;
206
        $issue->{'rentalfines'} = $rentalfines;
206
        $issue->{'rentalfines'} = $rentalfines;
207
        print STDERR "opac/opac-user: 1\n";
207
        my $marcrecord = GetMarcBiblio({ biblionumber => $issue->{'biblionumber'} });
208
        my $marcrecord = GetMarcBiblio({ biblionumber => $issue->{'biblionumber'} });
208
        $issue->{'subtitle'} = GetRecordValue('subtitle', $marcrecord, GetFrameworkCode($issue->{'biblionumber'}));
209
        $issue->{'subtitle'} = GetRecordValue('subtitle', $marcrecord, GetFrameworkCode($issue->{'biblionumber'}));
209
        # check if item is renewable
210
        # check if item is renewable
(-)a/serials/subscription-add.pl (+1 lines)
Lines 439-444 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
    print STDERR "serials/subscription-add: 1\n";
442
    my $record = GetMarcBiblio({
443
    my $record = GetMarcBiblio({
443
        biblionumber => $biblionumber,
444
        biblionumber => $biblionumber,
444
        embed_items  => 1 });
445
        embed_items  => 1 });
(-)a/svc/bib (+3 lines)
Lines 66-71 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
    print STDERR "svc/bib: 1\n";
69
    my $record = GetMarcBiblio({
70
    my $record = GetMarcBiblio({
70
        biblionumber => $biblionumber,
71
        biblionumber => $biblionumber,
71
        embed_items  => $query->url_param('items') });
72
        embed_items  => $query->url_param('items') });
Lines 80-85 sub fetch_bib { Link Here
80
sub update_bib {
81
sub update_bib {
81
    my $query = shift;
82
    my $query = shift;
82
    my $biblionumber = shift;
83
    my $biblionumber = shift;
84
    print STDERR "svc/bib: 2\n";
83
    my $old_record = GetMarcBiblio({ biblionumber => $biblionumber });
85
    my $old_record = GetMarcBiblio({ biblionumber => $biblionumber });
84
    unless  (defined $old_record) {
86
    unless  (defined $old_record) {
85
        print $query->header(-type => 'text/xml', -status => '404 Not Found');
87
        print $query->header(-type => 'text/xml', -status => '404 Not Found');
Lines 115-120 sub update_bib { Link Here
115
        }
117
        }
116
118
117
        ModBiblio( $record, $biblionumber, '' );
119
        ModBiblio( $record, $biblionumber, '' );
120
        print STDERR "svc/bib: 3\n";
118
        my $new_record = GetMarcBiblio({
121
        my $new_record = GetMarcBiblio({
119
            biblionumber => $biblionumber,
122
            biblionumber => $biblionumber,
120
            embed_items  => $query->url_param('items') });
123
            embed_items  => $query->url_param('items') });
(-)a/svc/checkouts (+1 lines)
Lines 165-170 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
165
        my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} });
165
        my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} });
166
        $damaged = $av->count ? $av->next->lib : '';
166
        $damaged = $av->count ? $av->next->lib : '';
167
    }
167
    }
168
    print STDERR "svc/checkouts: 1\n";
168
    my $checkout = {
169
    my $checkout = {
169
        DT_RowId             => $c->{itemnumber} . '-' . $c->{borrowernumber},
170
        DT_RowId             => $c->{itemnumber} . '-' . $c->{borrowernumber},
170
        title                => $c->{title},
171
        title                => $c->{title},
(-)a/svc/holds (+1 lines)
Lines 84-89 while ( my $h = $holds_rs->next() ) { Link Here
84
    for my $library ( @$libraries ) {
84
    for my $library ( @$libraries ) {
85
        $library->{selected} = 1 if $library->{branchcode} eq $h->branchcode();
85
        $library->{selected} = 1 if $library->{branchcode} eq $h->branchcode();
86
    }
86
    }
87
    print STDERR "svc/holds: 1\n";
87
    my $hold = {
88
    my $hold = {
88
        DT_RowId       => $h->reserve_id(),
89
        DT_RowId       => $h->reserve_id(),
89
        biblionumber   => $biblionumber,
90
        biblionumber   => $biblionumber,
(-)a/svc/new_bib (+2 lines)
Lines 75-80 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
        print STDERR "svc/new_bib: 1\n";
78
        my $new_record = GetMarcBiblio({ biblionumber => $biblionumber });
79
        my $new_record = GetMarcBiblio({ biblionumber => $biblionumber });
79
        if ( $query->url_param('items') ) {
80
        if ( $query->url_param('items') ) {
80
            foreach my $field ( $fullrecord->field($itemtag) ) {
81
            foreach my $field ( $fullrecord->field($itemtag) ) {
Lines 84-89 sub add_bib { Link Here
84
            }
85
            }
85
        }
86
        }
86
87
88
        print STDERR "svc/new_bib: 2\n";
87
        $new_record = GetMarcBiblio({
89
        $new_record = GetMarcBiblio({
88
            biblionumber => $biblionumber,
90
            biblionumber => $biblionumber,
89
            embed_items  => $query->url_param('items') });
91
            embed_items  => $query->url_param('items') });
(-)a/svc/records/preview (+1 lines)
Lines 32-37 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
    print STDERR "svc/records/preview: 1\n";
35
    $record = GetMarcBiblio({ biblionumber => $record_id });
36
    $record = GetMarcBiblio({ biblionumber => $record_id });
36
} else {
37
} else {
37
    my $authority = Koha::MetadataRecord::Authority->get_from_authid( $record_id );
38
    my $authority = Koha::MetadataRecord::Authority->get_from_authid( $record_id );
(-)a/tags/list.pl (+1 lines)
Lines 62-67 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
            print STDERR "tags/list: 1\n";
65
            my $record = &GetMarcBiblio({ biblionumber => $_->{biblionumber} });
66
            my $record = &GetMarcBiblio({ biblionumber => $_->{biblionumber} });
66
            $dat->{'subtitle'} =
67
            $dat->{'subtitle'} =
67
              GetRecordValue( 'subtitle', $record,
68
              GetRecordValue( 'subtitle', $record,
(-)a/tools/batch_delete_records.pl (+1 lines)
Lines 80-85 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
            print STDERR "tools/batch_delete_records: 1\n";
83
            my $record = &GetMarcBiblio({ biblionumber => $record_id });
84
            my $record = &GetMarcBiblio({ biblionumber => $record_id });
84
            $biblio->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $record_id ) );
85
            $biblio->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $record_id ) );
85
            $biblio->{itemnumbers} = C4::Items::GetItemnumbersForBiblio( $record_id );
86
            $biblio->{itemnumbers} = C4::Items::GetItemnumbersForBiblio( $record_id );
(-)a/tools/batch_record_modification.pl (+1 lines)
Lines 191-196 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
                print STDERR "tools/batch_record_modification: 1\n";
194
                my $record = GetMarcBiblio({ biblionumber => $biblionumber });
195
                my $record = GetMarcBiblio({ biblionumber => $biblionumber });
195
                ModifyRecordWithTemplate( $mmtid, $record );
196
                ModifyRecordWithTemplate( $mmtid, $record );
196
                my $frameworkcode = C4::Biblio::GetFrameworkCode( $biblionumber );
197
                my $frameworkcode = C4::Biblio::GetFrameworkCode( $biblionumber );
(-)a/tools/showdiffmarc.pl (+1 lines)
Lines 59-64 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
59
    }
59
    }
60
);
60
);
61
61
62
print STDERR "tools/showdiffmarc: 1\n";
62
$recordBiblionumber = GetMarcBiblio({
63
$recordBiblionumber = GetMarcBiblio({
63
    biblionumber => $biblionumber,
64
    biblionumber => $biblionumber,
64
    embed_items  => 'embed_items' });
65
    embed_items  => 'embed_items' });
(-)a/virtualshelves/downloadshelf.pl (+1 lines)
Lines 71-76 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
                    print STDERR "virtualshelves/downloadshelf: 1\n";
74
                    my $record = GetMarcBiblio({
75
                    my $record = GetMarcBiblio({
75
                        biblionumber => $biblionumber,
76
                        biblionumber => $biblionumber,
76
                        embed_items  => 1 });
77
                        embed_items  => 1 });
(-)a/virtualshelves/sendshelf.pl (+1 lines)
Lines 80-85 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
        print STDERR "virtualshelves/sendshelf: 1\n";
83
        my $record           = GetMarcBiblio({
84
        my $record           = GetMarcBiblio({
84
            biblionumber => $biblionumber,
85
            biblionumber => $biblionumber,
85
            embed_items  => 1 });
86
            embed_items  => 1 });
(-)a/virtualshelves/shelves.pl (-1 / +1 lines)
Lines 237-242 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
                print STDERR "virtualshelves/shelves: 1\n";
240
                my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
241
                my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
241
242
242
                if ( $xslfile ) {
243
                if ( $xslfile ) {
243
- 

Return to bug 19040