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)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 20 Dec 2013 13:38:50 +0000 (08:38 -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>

C4/Biblio.pm

index 7c3d0ef..1a4e978 100644 (file)
@@ -2851,6 +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;
         require C4::Items;
         my $item_marc = C4::Items::GetMarcItem($biblionumber, $itemnumber);
         push @item_fields, $item_marc->field($itemtag);