Bug 31312: Remove GetItemsInfo from misc/migration_tools/rebuild_zebra.pl
Hum... Item2Marc ok here? Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search. Here we are going to deal with misc/migration_tools/rebuild_zebra.pl Test plan: I am not sure, what do we want to test here? Items' info indexed correctly? Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
db42939885
commit
bd70e8989f
|
|
@ -25,7 +25,7 @@ use File::Temp qw( tempdir );
|
|||
use File::Path qw( mkpath rmtree );
|
||||
use C4::Biblio qw( GetXmlBiblio );
|
||||
use C4::AuthoritiesMarc qw( GetAuthority GetAuthorityXML );
|
||||
use C4::Items qw( GetItemsInfo Item2Marc );
|
||||
use C4::Items qw( Item2Marc );
|
||||
use Koha::RecordProcessor;
|
||||
use Koha::Caches;
|
||||
use XML::LibXML;
|
||||
|
|
@ -509,12 +509,14 @@ sub export_marc_records_from_sth {
|
|||
? GetXmlBiblio( $record_number )
|
||||
: GetAuthorityXML( $record_number );
|
||||
if ($record_type eq 'biblio'){
|
||||
my @items = GetItemsInfo($record_number);
|
||||
if (@items){
|
||||
my $biblio = Koha::Biblios->find($record_number);
|
||||
next unless $biblio;
|
||||
my $items = $biblio->items;
|
||||
if ($items->count){
|
||||
my $record = MARC::Record->new;
|
||||
$record->encoding('UTF-8');
|
||||
my @itemsrecord;
|
||||
foreach my $item (@items){
|
||||
for my $item ( @{$items->unblessed} ) {
|
||||
my $record = Item2Marc($item, $record_number);
|
||||
push @itemsrecord, $record->field($itemtag);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue