diff --git a/libraries/src/Component/Router/Rules/MenuRules.php b/libraries/src/Component/Router/Rules/MenuRules.php index 973d01095c252..467074704f72d 100644 --- a/libraries/src/Component/Router/Rules/MenuRules.php +++ b/libraries/src/Component/Router/Rules/MenuRules.php @@ -156,20 +156,16 @@ public function preprocess(&$query) } } - // Check if the active menuitem matches the requested language - if ($active && $active->component === 'com_' . $this->router->getName() - && ($language === '*' || in_array($active->language, array('*', $language)) || !\JLanguageMultilang::isEnabled())) + // If there is no view and task in query then add the default item id + if (!isset($query['view']) && !isset($query['task'])) { - $query['Itemid'] = $active->id; - return; - } - - // If not found, return language specific home link - $default = $this->router->menu->getDefault($language); + // If not found, return language specific home link + $default = $this->router->menu->getDefault($language); - if (!empty($default->id)) - { - $query['Itemid'] = $default->id; + if (!empty($default->id)) + { + $query['Itemid'] = $default->id; + } } } diff --git a/libraries/src/Router/SiteRouter.php b/libraries/src/Router/SiteRouter.php index 3653222cf0006..b9845fa92e253 100644 --- a/libraries/src/Router/SiteRouter.php +++ b/libraries/src/Router/SiteRouter.php @@ -707,26 +707,14 @@ protected function createUri($url) if ($itemid === null) { - if ($option = $uri->getVar('option')) + if (!$uri->getVar('option')) { - $item = $this->menu->getItem($this->getVar('Itemid')); + $option = $this->getVar('option'); - if ($item !== null && $item->component === $option) - { - $uri->setVar('Itemid', $item->id); - } - } - else - { - if ($option = $this->getVar('option')) + if ($option) { $uri->setVar('option', $option); } - - if ($itemid = $this->getVar('Itemid')) - { - $uri->setVar('Itemid', $itemid); - } } } else diff --git a/modules/mod_login/tmpl/default.php b/modules/mod_login/tmpl/default.php index fcd3b1c962c94..5ea82c8cbc019 100644 --- a/modules/mod_login/tmpl/default.php +++ b/modules/mod_login/tmpl/default.php @@ -15,7 +15,7 @@ JHtml::_('bootstrap.tooltip'); ?> -