Skip to content
Snippets Groups Projects
Commit 9ae45d3c authored by Anna Headley's avatar Anna Headley
Browse files

Fix bug in place holds functionality

Not all drivers implement the getDefaultPickUpLocation method. enclosed
it in a try/catch as is done in MyResearchController
parent df65156b
No related merge requests found
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment