From c8b3f2d3e6be71abe3916dfe5dc2ddde1c35da8b Mon Sep 17 00:00:00 2001
From: Dorian Merz <merz@ub.uni-leipzig.de>
Date: Fri, 14 Dec 2018 12:23:43 +0100
Subject: [PATCH] refs #14386

* checks for empty values in _hasILSData
* changes token for purchase info
* uses older token instead of full english text for translation
* see #7841, #4790
---
 module/finc/src/finc/ILS/Driver/FincILS.php       | 7 ++++++-
 themes/finc/templates/RecordTab/holdingsils.phtml | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/module/finc/src/finc/ILS/Driver/FincILS.php b/module/finc/src/finc/ILS/Driver/FincILS.php
index ea7d4a033e6..c248d02853c 100644
--- a/module/finc/src/finc/ILS/Driver/FincILS.php
+++ b/module/finc/src/finc/ILS/Driver/FincILS.php
@@ -1381,7 +1381,12 @@ class FincILS extends PAIA implements LoggerAwareInterface
             list($methodName, $methodReturn) = explode(':', $value);
             // if we have one mismatch we can already stop as this record does
             // not qualify for querying the ILS
-            if (!in_array($methodReturn, (array) $this->_getRecord($id)->tryMethod($methodName))) {
+            if ($methodReturn === ""){
+                if (!is_null($this->_getRecord($id)->tryMethod($methodName))) {
+                    return false;
+                }
+            }
+            elseif (!in_array($methodReturn, (array) $this->_getRecord($id)->tryMethod($methodName))) {
                 return false;
             }
         }
diff --git a/themes/finc/templates/RecordTab/holdingsils.phtml b/themes/finc/templates/RecordTab/holdingsils.phtml
index 42faaa8d261..5b8928a98bf 100644
--- a/themes/finc/templates/RecordTab/holdingsils.phtml
+++ b/themes/finc/templates/RecordTab/holdingsils.phtml
@@ -226,7 +226,7 @@ if (!empty($holdingTitleHold)): ?>
 
 <? /* finc-specific: nxt 3 lines - #7841@56988450 - CK */ ?>
 <? if ($holdingsEmpty && $this->driver->tryMethod('getLocalOrderInformation') == 'e'): ?>
-  <h3><?=$this->transEsc("This item has already been ordered and will be available shortly")?></h3>
+  <h3><?=$this->transEsc("title_ordered_by_library")?></h3>
 <? endif; ?>
 
 <? /* finc-specific - external access - #9245 - CK */ ?>
-- 
GitLab