From 6539e0bdb739920af4d9ad413071ad2b41a8df86 Mon Sep 17 00:00:00 2001
From: Thomas Misilo <misilot@users.noreply.github.com>
Date: Tue, 19 Jul 2016 14:01:13 -0400
Subject: [PATCH] Added a Coalesce of the location value (#760)

Added a coalesce of the location value, so it first checks for the OPAC Description, the general description, and if that doesn't exist it falls back to the Location's internal code.
---
 module/VuFind/src/VuFind/ILS/Driver/KohaILSDI.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/ILS/Driver/KohaILSDI.php b/module/VuFind/src/VuFind/ILS/Driver/KohaILSDI.php
index 13281a08a4c..62ffeb1000a 100644
--- a/module/VuFind/src/VuFind/ILS/Driver/KohaILSDI.php
+++ b/module/VuFind/src/VuFind/ILS/Driver/KohaILSDI.php
@@ -651,7 +651,8 @@ class KohaILSDI extends \VuFind\ILS\Driver\AbstractBase implements
         $loc = $shelf = '';
         $reserves = "N";
 
-        $sql = "select i.itemnumber as ITEMNO, i.location, av.lib_opac AS LOCATION,
+        $sql = "select i.itemnumber as ITEMNO, i.location, 
+            COALESCE(av.lib_opac,av.lib, av.authorised_value) AS LOCATION,
             i.holdingbranch as HLDBRNCH, i.homebranch as HOMEBRANCH,
             i.reserves as RESERVES, i.itemcallnumber as CALLNO, i.barcode as BARCODE,
             i.copynumber as COPYNO, i.notforloan as NOTFORLOAN,
-- 
GitLab