Bugzilla – Attachment 138846 Details for
Bug 31312
Remove GetItemsInfo from misc/migration_tools/rebuild_zebra.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31312: Remove GetItemsInfo from misc/migration_tools/rebuild_zebra.pl
Bug-31312-Remove-GetItemsInfo-from-miscmigrationto.patch (text/plain), 2.11 KB, created by
Owen Leonard
on 2022-08-08 17:48:09 UTC
(
hide
)
Description:
Bug 31312: Remove GetItemsInfo from misc/migration_tools/rebuild_zebra.pl
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-08-08 17:48:09 UTC
Size:
2.11 KB
patch
obsolete
>From 34038e6b0dc027e3715fb6deec39a4bca60519d4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 2 Jun 2022 11:38:02 +0200 >Subject: [PATCH] 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> >--- > misc/migration_tools/rebuild_zebra.pl | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl >index 6dbce38736..a73e7bdd2f 100755 >--- a/misc/migration_tools/rebuild_zebra.pl >+++ b/misc/migration_tools/rebuild_zebra.pl >@@ -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); > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31312
:
138820
|
138846
|
138979