Skip to content

Commit

Permalink
Tags router: do not force incorrect Itemid (#40448)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedik committed Apr 21, 2023
1 parent 1e601c5 commit c93bdfd
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions components/com_tags/src/Service/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,6 @@ public function preprocess($query)
$query['Itemid'] = $active->id;
}

// If not found, return language specific home link
if (!isset($query['Itemid'])) {
$default = $this->menu->getDefault($language);

if (!empty($default->id)) {
$query['Itemid'] = $default->id;
}
}

return $query;
}

Expand All @@ -152,9 +143,9 @@ public function build(&$query)
{
$segments = [];

$menuItem = $this->menu->getItem($query['Itemid']);
$menuItem = !empty($query['Itemid']) ? $this->menu->getItem($query['Itemid']) : false;

if ($menuItem->query['option'] == 'com_tags') {
if ($menuItem && $menuItem->query['option'] == 'com_tags') {
if ($menuItem->query['view'] == 'tags' && isset($query['id'])) {
$ids = $query['id'];

Expand Down

0 comments on commit c93bdfd

Please sign in to comment.