From 865fe36fdf4bce111b2d67549eb0583a28a50ad3 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Tue, 12 May 2015 12:30:02 -0400
Subject: [PATCH] Fixed broken collection tab functionality. - Resolves
 VUFIND-1113.

---
 module/VuFind/src/VuFind/RecordTab/CollectionList.php | 11 +++++++++++
 module/VuFind/src/VuFind/RecordTab/HierarchyTree.php  | 11 +++++++++++
 themes/bootstrap3/templates/collection/view.phtml     |  6 +++---
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/module/VuFind/src/VuFind/RecordTab/CollectionList.php b/module/VuFind/src/VuFind/RecordTab/CollectionList.php
index c2d64a118b6..eff74b5c74a 100644
--- a/module/VuFind/src/VuFind/RecordTab/CollectionList.php
+++ b/module/VuFind/src/VuFind/RecordTab/CollectionList.php
@@ -112,4 +112,15 @@ class CollectionList extends AbstractBase
     {
         return $this->getResults()->getRecommendations('side');
     }
+
+    /**
+     * Can this tab be loaded via AJAX?
+     *
+     * @return bool
+     */
+    public function supportsAjax()
+    {
+        // No, special sidebar needed.
+        return false;
+    }
 }
\ No newline at end of file
diff --git a/module/VuFind/src/VuFind/RecordTab/HierarchyTree.php b/module/VuFind/src/VuFind/RecordTab/HierarchyTree.php
index 5791f08365d..3911269be09 100644
--- a/module/VuFind/src/VuFind/RecordTab/HierarchyTree.php
+++ b/module/VuFind/src/VuFind/RecordTab/HierarchyTree.php
@@ -205,4 +205,15 @@ class HierarchyTree extends AbstractBase
         return isset($config->Hierarchy->treeSearchLimit)
             ? $config->Hierarchy->treeSearchLimit : -1;
     }
+
+    /**
+     * Can this tab be loaded via AJAX?
+     *
+     * @return bool
+     */
+    public function supportsAjax()
+    {
+        // No, special width adjustment needed.
+        return false;
+    }
 }
\ No newline at end of file
diff --git a/themes/bootstrap3/templates/collection/view.phtml b/themes/bootstrap3/templates/collection/view.phtml
index 2bd1d8491fb..fc4b82ae9b0 100644
--- a/themes/bootstrap3/templates/collection/view.phtml
+++ b/themes/bootstrap3/templates/collection/view.phtml
@@ -47,7 +47,7 @@
 <?=$this->record($this->driver)->getToolbar()?>
 
 <div class="row">
-  <div class="<?=$this->layoutClass('mainbody') ?>">
+  <div class="<?=$tree ? 'col-sm-12' : $this->layoutClass('mainbody') ?>">
     <div class="record">
       <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId" id="record_id" />
       <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" class="hiddenSource" />
@@ -67,8 +67,8 @@
             $this->layout()->breadcrumbs .= ' <li class="active">' . $this->transEsc($desc) . '</li>';
             $activeTabObj = $obj;
           }
-          if (!$obj->isVisible()) { $tab_classes = 'hidden'; }
-          if (!$obj->supportsAjax()) { $tab_classes = 'noajax'; }
+          if (!$obj->isVisible()) { $tab_classes[] = 'hidden'; }
+          if (!$obj->supportsAjax()) { $tab_classes[] = 'noajax'; }
         ?>
         <li<?=count($tab_classes) > 0 ? ' class="' . implode(' ', $tab_classes) . '"' : ''?>>
           <a id="<?=strtolower($tab) ?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"><?=$this->transEsc($desc)?></a>
-- 
GitLab