diff --git a/components/com_tags/src/Service/Router.php b/components/com_tags/src/Service/Router.php index 3f49973737316..213e189a5f50f 100644 --- a/components/com_tags/src/Service/Router.php +++ b/components/com_tags/src/Service/Router.php @@ -363,6 +363,8 @@ protected function buildLookup() $items = $this->app->getMenu()->getItems(['component_id'], [$component->id]); foreach ($items as $item) { + $itemParams = $item->getParams(); + if (!isset($this->lookup[$item->language])) { $this->lookup[$item->language] = ['tags' => [], 'tag' => []]; } @@ -372,8 +374,11 @@ protected function buildLookup() sort($id); $this->lookup[$item->language]['tag'][implode(',', $id)] = $item->id; - foreach ($id as $i) { - $this->lookup[$item->language]['tag'][$i] = $item->id; + // Only apply to menu items with match type any + if ($itemParams->get('return_any_or_all') == 1) { + foreach ($id as $i) { + $this->lookup[$item->language]['tag'][$i] = $item->id; + } } }