diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/HeadScript.php b/module/VuFind/src/VuFind/Theme/Root/Helper/HeadScript.php index 85dad353b9c35814b41b10f45996d0788fefdf4b..36269252ad932fb0fb7c7560e75dfbc87c36a999 100644 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/HeadScript.php +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/HeadScript.php @@ -52,13 +52,15 @@ class HeadScript extends \Zend\View\Helper\HeadScript public function itemToString($item, $indent, $escapeStart, $escapeEnd) { // Normalize href to account for themes: - $relPath = 'js/' . $item->attributes['src']; - $currentTheme = ThemeTools::findContainingTheme($relPath); + if (!empty($item->attributes['src'])) { + $relPath = 'js/' . $item->attributes['src']; + $currentTheme = ThemeTools::findContainingTheme($relPath); - if (!empty($currentTheme)) { - $urlHelper = $this->getView()->plugin('url'); - $item->attributes['src'] - = $urlHelper('home') . "themes/$currentTheme/" . $relPath; + if (!empty($currentTheme)) { + $urlHelper = $this->getView()->plugin('url'); + $item->attributes['src'] + = $urlHelper('home') . "themes/$currentTheme/" . $relPath; + } } return parent::itemToString($item, $indent, $escapeStart, $escapeEnd);