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

(-)a/misc/migration_tools/rebuild_zebra.pl (-5 / +6 lines)
Lines 25-31 use File::Temp qw( tempdir ); Link Here
25
use File::Path qw( mkpath rmtree );
25
use File::Path qw( mkpath rmtree );
26
use C4::Biblio qw( GetXmlBiblio );
26
use C4::Biblio qw( GetXmlBiblio );
27
use C4::AuthoritiesMarc qw( GetAuthority GetAuthorityXML );
27
use C4::AuthoritiesMarc qw( GetAuthority GetAuthorityXML );
28
use C4::Items qw( GetItemsInfo Item2Marc );
28
use C4::Items qw( Item2Marc );
29
use Koha::RecordProcessor;
29
use Koha::RecordProcessor;
30
use Koha::Caches;
30
use Koha::Caches;
31
use XML::LibXML;
31
use XML::LibXML;
Lines 509-520 sub export_marc_records_from_sth { Link Here
509
                          ? GetXmlBiblio( $record_number )
509
                          ? GetXmlBiblio( $record_number )
510
                          : GetAuthorityXML( $record_number );
510
                          : GetAuthorityXML( $record_number );
511
            if ($record_type eq 'biblio'){
511
            if ($record_type eq 'biblio'){
512
                my @items = GetItemsInfo($record_number);
512
                my $biblio = Koha::Biblios->find($record_number);
513
                if (@items){
513
                next unless $biblio;
514
                my $items = $biblio->items;
515
                if ($items->count){
514
                    my $record = MARC::Record->new;
516
                    my $record = MARC::Record->new;
515
                    $record->encoding('UTF-8');
517
                    $record->encoding('UTF-8');
516
                    my @itemsrecord;
518
                    my @itemsrecord;
517
                    foreach my $item (@items){
519
                    for my $item ( @{$items->unblessed} ) {
518
                        my $record = Item2Marc($item, $record_number);
520
                        my $record = Item2Marc($item, $record_number);
519
                        push @itemsrecord, $record->field($itemtag);
521
                        push @itemsrecord, $record->field($itemtag);
520
                    }
522
                    }
521
- 

Return to bug 27272