From 2678611a39b88d878e0d69161b08f55c11f46d9c Mon Sep 17 00:00:00 2001
From: Alexander Purr <purr@ub.uni-leipzig.de>
Date: Thu, 13 Jul 2023 12:13:08 +0200
Subject: [PATCH] refs #23220 [finc] list-entry header

* add closing div and header to prevent broken html structure
* failure only on collections (dico records - only de_15)
* just hotfix - will be solved more elegantly with ticket 24265

* refactor summInCollection display logic
** remove FALSE from if-statement, condition was never fulfilled
** use $collId correctly
---
 .../RecordDriver/DefaultRecord/list-entry.phtml        | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml
index e924df0fcaa..c00132f723e 100644
--- a/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml
+++ b/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml
@@ -69,6 +69,10 @@
 
           <div class="resultItemLine2">
           <?php if ($this->driver->isCollection()): ?>
+            <?php // finc: add closing div and header #23220 - was missing in #19396 ff.
+                  // just hotfix - will be improved with #24265 ?>
+              </div>
+            </header>
             <?=implode('<br>', array_map([$this, 'escapeHtml'], $this->driver->getSummary())); ?>
           <?php else: ?>
             <?php $summAuthors = $this->driver->getPrimaryAuthors();
@@ -91,12 +95,14 @@
             <?php elseif (!empty($summDate)): ?>
               <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate[0])?>
             <?php endif; ?>
+            <?php // finc: remove FALSE from if-statement, condition was never fulfilled #23220 ?>
             <?php $summInCollection = $this->driver->getContainingCollections();
-            if (false && !empty($summInCollection)): ?>
+            if (!empty($summInCollection)): ?>
               <?php foreach ($summInCollection as $collId => $collText): ?>
                 <div>
                   <strong><?=$this->transEsc("in_collection_label")?></strong>
-                  <a class="collectionLinkText" href="<?=$this->record($this->driver)->getLink('collection', $collid)?>">
+                  <?php // finc: use $collId correctly #23220 ?>
+                  <a class="collectionLinkText" href="<?=$this->record($this->driver)->getLink('collection', $collId)?>">
                     <?=$this->escapeHtml($collText)?>
                   </a>
                 </div>
-- 
GitLab