From 26467f0a701e804d5d838d629077a79fa0347074 Mon Sep 17 00:00:00 2001
From: Robert Lange <robert.lange@uni-leipzig.de>
Date: Wed, 8 Sep 2021 14:29:03 +0200
Subject: [PATCH] refs #20550 [finc] cover: load default icon for missing
 records

* avoid loading spinner
---
 themes/finc/templates/record/cover.phtml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/themes/finc/templates/record/cover.phtml b/themes/finc/templates/record/cover.phtml
index e557d2210f7..6ee4c1314de 100644
--- a/themes/finc/templates/record/cover.phtml
+++ b/themes/finc/templates/record/cover.phtml
@@ -3,7 +3,13 @@
 <?php /* If you want to load covers in lightbox use .recordcover;
   the class .nocover prevents nocover images from loading in lightbox or can be used to hide the images */ ?>
 <?php $alt = $alt ?? $this->transEsc('Cover Image')?>
-<?php $coverId = "cover-" . $driver->getUniqueID() . "-" . time(); ?>
+<?php $id = $driver->getUniqueID() ?>
+<?php if ($id) {
+  $coverId = "cover-$id-" . time();
+} else {
+  $cover = false;
+}
+?>
 <?php if ($cover): ?>
   <?php if ($this->link): ?><a id="<?=$coverId?>" href="<?=$this->escapeHtmlAttr($this->link)?>" tabindex="-1" aria-hidden="true"><?php endif; ?>
   <img alt="<?=$alt?>" <?php if ($linkPreview): ?>data-linkpreview="true" <?php endif; ?>class="recordcover" src="<?=$this->escapeHtmlAttr($cover); ?>" />
-- 
GitLab