Bug 9046: Followup FIX perl v.10 raises an error if itemnumbers if undefined 3.8.x
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 12 Nov 2012 09:18:30 +0000 (10:18 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 5 May 2014 11:29:19 +0000 (07:29 -0400)
If the itemnumbers parameter is undef, perl raises an error :
"Can't use an undefined value as an ARRAY reference"

Signed-off-by: Mason James <mtj@kohaaloha.com>

C4/Biblio.pm

index 1a4e978..093fdaf 100644 (file)
@@ -2841,6 +2841,8 @@ sub EmbedItemsInMarcBiblio {
     my ($marc, $biblionumber) = @_;
     croak "No MARC record" unless $marc;
 
+    $itemnumbers = [] unless defined $itemnumbers;
+
     my $frameworkcode = GetFrameworkCode($biblionumber);
     _strip_item_fields($marc, $frameworkcode);