diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/IconTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/IconTest.php index c5593bfa2df..c1c77440533 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/IconTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/IconTest.php @@ -34,6 +34,7 @@ use Laminas\View\Helper\EscapeHtmlAttr; use VuFind\Escaper\Escaper; use VuFind\View\Helper\Root\Icon; +use VuFindTheme\View\Helper\AssetPipeline; use VuFindTheme\View\Helper\ImageLink; /** @@ -137,6 +138,7 @@ protected function getIconHelper( ); $plugins = array_merge( [ + 'assetPipeline' => $this->createMock(AssetPipeline::class), 'escapeHtmlAttr' => new EscapeHtmlAttr($escaper), ], $plugins diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php index bf40fb8ff5d..c637db39e23 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php @@ -89,6 +89,7 @@ protected function getViewHelpers($container): array }); $record->setDbServiceManager($serviceManager); return [ + 'assetPipeline' => new \VuFindTheme\View\Helper\AssetPipeline(), 'auth' => new \VuFind\View\Helper\Root\Auth( $this->createMock(\VuFind\Auth\Manager::class), $this->createMock(\VuFind\Auth\ILSAuthenticator::class) diff --git a/themes/root/templates/Helpers/icons/font.phtml b/themes/root/templates/Helpers/icons/font.phtml index 8d628755911..37de7c05794 100644 --- a/themes/root/templates/Helpers/icons/font.phtml +++ b/themes/root/templates/Helpers/icons/font.phtml @@ -1,5 +1,7 @@ assetPipeline()->appendStylesheet($this->src); + if ($this->src) { + $this->assetPipeline()->appendStylesheet($this->src); + } $className = trim('icon icon--font ' . $this->icon . ' ' . ($this->extra['class'] ?? '')); ?> attrs ?> role="img" aria-hidden="true">