From 999dc8d96c59b6fad0d4f7b85e26c6f0c1cf401b Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Thu, 12 Mar 2015 10:36:41 -0400
Subject: [PATCH] Added isset() check to account for case where unexpected
 record ID is returned.

---
 module/VuFind/src/VuFind/Record/Loader.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/Record/Loader.php b/module/VuFind/src/VuFind/Record/Loader.php
index accb5179c5c..6ca7e4653ee 100644
--- a/module/VuFind/src/VuFind/Record/Loader.php
+++ b/module/VuFind/src/VuFind/Record/Loader.php
@@ -148,7 +148,13 @@ class Loader
             $records = $this->loadBatchForSource(array_keys($details), $source);
             foreach ($records as $current) {
                 $id = $current->getUniqueId();
-                $retVal[$details[$id]] = $current;
+                // In theory, we should be able to assume that $details[$id] is
+                // set... but in practice, we can't make that assumption. In some
+                // cases, Summon IDs will change, and requests for an old ID value
+                // will return a record with a different ID.
+                if (isset($details[$id])) {
+                    $retVal[$details[$id]] = $current;
+                }
             }
         }
 
-- 
GitLab