Check for repeated BibliographId in NCIP::ILS->find_bibliographic_id.
authorJason Stephenson <jason@sigio.com>
Mon, 22 Sep 2014 17:20:57 +0000 (13:20 -0400)
committerJason Stephenson <jason@sigio.com>
Mon, 22 Sep 2014 17:20:57 +0000 (13:20 -0400)
Signed-off-by: Jason Stephenson <jason@sigio.com>
lib/NCIP/ILS.pm

index 9caa595..bbc88a6 100644 (file)
@@ -423,6 +423,9 @@ sub find_bibliographic_id {
         $idxml = $request->{$message}->{BibliographicId};
     }
     if ($idxml) {
+        # BibliographicId is repeatable in some messages, but we only
+        # use the first one.
+        $idxml = $idxml->[0] if (ref($idxml) eq 'ARRAY');
         if ($idxml->{BibliographicRecordId}) {
             my ($identifier, $agencyid, $code);
             $identifier = $idxml->{BibliographicRecordId}->{BibliographicRecordIdentifier};