diff --git a/code/web/interface/themes/responsive/EBSCO/searchError.tpl b/code/web/interface/themes/responsive/EBSCO/searchError.tpl
index 4436c7d748..32bb9a5c52 100644
--- a/code/web/interface/themes/responsive/EBSCO/searchError.tpl
+++ b/code/web/interface/themes/responsive/EBSCO/searchError.tpl
@@ -10,10 +10,10 @@
{/if}
- {if !empty($searchError) && !empty($searchError.error.msg)}
+ {if !empty($searchError) && !empty($searchError->getMessage())}
{translate text="Error description" isPublicFacing=true}
- {$searchError.error.msg}
+ {$searchError->getMessage()}
{/if}
\ No newline at end of file
diff --git a/code/web/release_notes/24.10.00.MD b/code/web/release_notes/24.10.00.MD
index f068d4d798..94e2d8ed21 100644
--- a/code/web/release_notes/24.10.00.MD
+++ b/code/web/release_notes/24.10.00.MD
@@ -173,6 +173,7 @@
- E-commerce: SnapPay: drop unused database field and other small fixes. (*JStaub*)
- Correct cron artifact within new default intellij project. (*MDN*)
- When batch updating enumerations, display the label for the new value rather than the internal value. (*MDN*)
+- Fix an issue where EBSCO EDS search errors were echoed to the UI on the search page (visible to any visitor) by adding the error message to the logs instead. (*CZ*)
## This release includes code contributions from
###ByWater Solutions
diff --git a/code/web/sys/SearchObject/EbscoEdsSearcher.php b/code/web/sys/SearchObject/EbscoEdsSearcher.php
index b5046d590e..4f8c3e8283 100644
--- a/code/web/sys/SearchObject/EbscoEdsSearcher.php
+++ b/code/web/sys/SearchObject/EbscoEdsSearcher.php
@@ -126,6 +126,7 @@ public function getCurlConnection() {
}
public function authenticate() {
+ global $logger;
if (SearchObject_EbscoEdsSearcher::$authenticationToken == null) {
global $library;
$settings = $this->getSettings();
@@ -185,13 +186,13 @@ public function authenticate() {
//echo("Authenticated in EDS!");
return true;
} elseif ($createSessionResponse->ErrorDescription) {
- echo("create session failed, " . print_r($createSessionResponse));
- return false;
+ $logger->log("create session failed, " . print_r($createSessionResponse, true), Logger::LOG_WARNING);
+ return new AspenError("Error processing search in EBSCO EDS");
}
}
} else {
- echo("Authentication failed!, $return");
- return false;
+ $logger->log("Error processing search in EBSCO EDS: " . print_r($return, true), Logger::LOG_WARNING);
+ return new AspenError("Error processing search in EBSCO EDS: Authentication failed");
}
} else {
return false;
@@ -553,9 +554,13 @@ function getSearchesFile() {
}
public function processSearch($returnIndexErrors = false, $recommendations = false, $preventQueryModification = false) {
- if (!$this->authenticate()) {
+ $isAuthenticated = $this->authenticate();
+ if (empty($isAuthenticated)) {
return null;
}
+ if (get_class($isAuthenticated) == 'AspenError') {
+ return $isAuthenticated;
+ }
$this->startQueryTimer();
$hasSearchTerm = false;