Skip to content

Commit

Permalink
Tags router: unset Itemid for not matching menu, in the end of build (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedik committed Apr 24, 2023
1 parent c93bdfd commit fe8413e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/com_tags/src/Service/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ 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 Down Expand Up @@ -173,7 +182,7 @@ public function build(&$query)
unset($query['view']);
} else {
$segments[] = $query['view'];
unset($query['view']);
unset($query['view'], $query['Itemid']);

if (isset($query['id']) && is_array($query['id'])) {
foreach ($query['id'] as $id) {
Expand Down

0 comments on commit fe8413e

Please sign in to comment.