From 9ae45d3c942a45a78103daff63063f83aaeac797 Mon Sep 17 00:00:00 2001
From: Anna Headley <anna3LC@gmail.com>
Date: Wed, 18 Dec 2013 14:41:46 -0500
Subject: [PATCH] Fix bug in place holds functionality

Not all drivers implement the getDefaultPickUpLocation method. enclosed
it in a try/catch as is done in MyResearchController
---
 .../VuFind/src/VuFind/Controller/RecordController.php  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/module/VuFind/src/VuFind/Controller/RecordController.php b/module/VuFind/src/VuFind/Controller/RecordController.php
index f986c0d2dc9..8cfb22f4afa 100644
--- a/module/VuFind/src/VuFind/Controller/RecordController.php
+++ b/module/VuFind/src/VuFind/Controller/RecordController.php
@@ -148,14 +148,18 @@ class RecordController extends AbstractRecord
         $defaultRequired = $this->holds()->getDefaultRequiredDate($checkHolds);
         $defaultRequired = $this->getServiceLocator()->get('VuFind\DateConverter')
             ->convertToDisplayDate("U", $defaultRequired);
+        try {
+            $defaultPickup = $catalog->getDefaultPickUpLocation($patron, $gatheredDetails);
+        } catch (\Exception $e) {
+            $defaultPickup = false;
+        }
+
 
         return $this->createViewModel(
             array(
                 'gatheredDetails' => $gatheredDetails,
                 'pickup' => $pickup,
-                'defaultPickup' => $catalog->getDefaultPickUpLocation(
-                    $patron, $gatheredDetails
-                ),
+                'defaultPickup' => $defaultPickup,
                 'homeLibrary' => $this->getUser()->home_library,
                 'extraHoldFields' => $extraHoldFields,
                 'defaultRequiredDate' => $defaultRequired
-- 
GitLab