Bug 9046: FIX wrong test on an arrayref instead of an array
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 9 Nov 2012 17:34:40 +0000 (18:34 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Tue, 20 Nov 2012 11:52:51 +0000 (06:52 -0500)
EmbedItemsInMarcBiblio does not embed items when the itemnumbers param
is given. That breaks the export tools (used from commandline).

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Biblio.pm

index eb213d5..478bd55 100644 (file)
@@ -2851,7 +2851,7 @@ sub EmbedItemsInMarcBiblio {
     my @item_fields;
     my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
     while (my ($itemnumber) = $sth->fetchrow_array) {
-        next if $itemnumbers and not grep { $_ == $itemnumber } @$itemnumbers;
+        next if @$itemnumbers and not grep { $_ == $itemnumber } @$itemnumbers;
         require C4::Items;
         my $item_marc = C4::Items::GetMarcItem($biblionumber, $itemnumber);
         push @item_fields, $item_marc->field($itemtag);