Bug 9046: Followup FIX perl v5.10 raises an error if itemnumbers if undefined
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 12 Nov 2012 09:18:30 +0000 (10:18 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Tue, 20 Nov 2012 12:31:33 +0000 (07:31 -0500)
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>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Biblio.pm

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