Skip to content
Snippets Groups Projects
Commit 7be967f2 authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Improved Voyager / MultiBackend ILL behavior (#945)

- Fixed Voyager ILL requests by passing on empty array indicate that a patron is logged in but not available for the current catalog.
parent ae7e3dd2
No related merge requests found
......@@ -215,9 +215,11 @@ class MultiBackend extends AbstractBase implements \Zend\Log\LoggerAwareInterfac
$source = $this->getSource($id);
$driver = $this->getDriver($source);
if ($driver) {
// Don't pass on patron information belonging to another source
// If the patron belongs to another source, just pass on an empty array
// to indicate that the patron has logged in but is not available for the
// current catalog.
if ($patron && $this->getSource($patron['cat_username']) !== $source) {
$patron = null;
$patron = [];
}
$holdings = $driver->getHolding(
$this->getLocalId($id),
......
......@@ -1016,7 +1016,7 @@ EOT;
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function processHoldingData($data, $id, $patron = false)
protected function processHoldingData($data, $id, $patron = null)
{
$holding = [];
......
......@@ -477,11 +477,11 @@ class VoyagerRestful extends Voyager implements \VuFindHttp\HttpServiceAwareInte
*
* @param array $data Item Data
* @param string $id The BIB record id
* @param mixed $patron Patron Data or boolean false
* @param array $patron Patron Data
*
* @return array Keyed data
*/
protected function processHoldingData($data, $id, $patron = false)
protected function processHoldingData($data, $id, $patron = null)
{
$holding = parent::processHoldingData($data, $id, $patron);
......@@ -551,7 +551,8 @@ class VoyagerRestful extends Voyager implements \VuFindHttp\HttpServiceAwareInte
$ILLRequest = '';
$addILLRequestLink = false;
if ($patron && $isILLRequestAllowed) {
// Check only that a patron has logged in
if (null !== $patron && $isILLRequestAllowed) {
$ILLRequest = 'auto';
$addILLRequestLink = 'check';
}
......
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