Skip to content

Commit

Permalink
Directly initialize the ILS driver in the results template instead of…
Browse files Browse the repository at this point in the history
… having getOfflineMode do it
  • Loading branch information
meganschanz committed Jan 15, 2025
1 parent 74e57af commit 3f98865
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions module/VuFind/src/VuFind/ILS/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -968,9 +968,11 @@ public function getHoldsMode()
*/
public function getOfflineMode($healthCheck = false)
{
// Always initialize the driver so that authentication tokens, if any,
// can be saved in the session cache
$this->getDriver();
// If we have NoILS failover configured, force driver initialization so
// we can know we are checking the offline mode against the correct driver.
if ($this->hasNoILSFailover()) {
$this->getDriver();
}

// If we need to perform a health check, try to do a random item lookup
// before proceeding.
Expand Down
3 changes: 2 additions & 1 deletion themes/bootstrap3/templates/search/results.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@

// Initialize the ILS driver so authentication tokens (if any) can be written to the session cache
// since subsequent AJAX calls to the ILS driver can only read from the session cache
$this->ils()->getOfflineMode();
$this->ils()->getDriver();

?>

<h1 class="sr-only"><?=$this->escapeHtml($headTitle)?></h1>
Expand Down
2 changes: 1 addition & 1 deletion themes/bootstrap5/templates/search/results.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

// Initialize the ILS driver so authentication tokens (if any) can be written to the session cache
// since subsequent AJAX calls to the ILS driver can only read from the session cache
$this->ils()->getOfflineMode();
$this->ils()->getDriver();
?>

<h1 class="sr-only"><?=$this->escapeHtml($headTitle)?></h1>
Expand Down

0 comments on commit 3f98865

Please sign in to comment.