From 033ff2bb3c17ae290d2880de8a6a75dc59eda6e1 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 16 Oct 2024 18:27:03 +0200 Subject: [PATCH] SEF URLs: Check if SEF plugin is published --- components/com_tags/src/Service/Router.php | 7 ++++++- libraries/src/Component/Router/Rules/MenuRules.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/components/com_tags/src/Service/Router.php b/components/com_tags/src/Service/Router.php index e96b23363f43e..9c2118117bf7d 100644 --- a/components/com_tags/src/Service/Router.php +++ b/components/com_tags/src/Service/Router.php @@ -76,7 +76,12 @@ public function __construct(SiteApplication $app, AbstractMenu $menu, ?CategoryF parent::__construct($app, $menu); $sefPlugin = PluginHelper::getPlugin('system', 'sef'); - $this->sefparams = new Registry($sefPlugin->params); + + if ($sefPlugin) { + $this->sefparams = new Registry($sefPlugin->params); + } else { + $this->sefparams = new Registry(); + } $this->buildLookup(); } diff --git a/libraries/src/Component/Router/Rules/MenuRules.php b/libraries/src/Component/Router/Rules/MenuRules.php index 9fc82938f5e61..4deac6ec64a1a 100644 --- a/libraries/src/Component/Router/Rules/MenuRules.php +++ b/libraries/src/Component/Router/Rules/MenuRules.php @@ -63,7 +63,12 @@ public function __construct(RouterView $router) { $this->router = $router; $sefPlugin = PluginHelper::getPlugin('system', 'sef'); - $this->sefparams = new Registry($sefPlugin->params); + + if ($sefPlugin) { + $this->sefparams = new Registry($sefPlugin->params); + } else { + $this->sefparams = new Registry(); + } $this->buildLookup(); }