From c8c188999600deba9faf6278a1fc99bc9d49ce69 Mon Sep 17 00:00:00 2001 From: "lina.wolf" Date: Sat, 4 May 2024 15:19:12 +0200 Subject: [PATCH] [BUGFIX] Fix link in Admin Module resolves #110 --- Classes/Controller/AdminModuleController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Classes/Controller/AdminModuleController.php b/Classes/Controller/AdminModuleController.php index d14008f..638b915 100644 --- a/Classes/Controller/AdminModuleController.php +++ b/Classes/Controller/AdminModuleController.php @@ -18,6 +18,7 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Backend\Attribute\AsController; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Backend\Template\Components\ButtonBar; use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\Template\ModuleTemplateFactory; @@ -32,6 +33,7 @@ public function __construct( protected ModuleTemplateFactory $moduleTemplateFactory, protected IconFactory $iconFactory, + private UriBuilder $uriBuilder, // ... ) {} @@ -89,8 +91,9 @@ private function setUpDocHeader( ModuleTemplate $view, ): void { $buttonBar = $view->getDocHeaderComponent()->getButtonBar(); + $uriBuilderPath = $this->uriBuilder->buildUriFromRoute('web_list', ['id' => 0]); $list = $buttonBar->makeLinkButton() - ->setHref('') + ->setHref($uriBuilderPath) ->setTitle('A Title') ->setShowLabelText(true) ->setIcon($this->iconFactory->getIcon('actions-extension-import', IconSize::SMALL->value));