In my case I have Itemid 120 for "Tagged Items" and Itemid 123 for "Compact List of Tagged Items"
I made a simple system plugin and used "onBeforeCompileHead" and "onContentPrepareForm" events to show site routing of the same "Tagged Items" URL on Front-end and Back-end.
public function onBeforeCompileHead()
{
$doc = $this->app->getDocument();
if (!($this->app->isClient('site')) || ($doc->getType() != 'html')) return;
$testURL = 'index.php?option=com_tags&view=tag&id[0]=2&types[0]=1&Itemid=120';
echo 'Routed URL: '.ROUTE::link('site', $testURL);
}
public function onContentPrepareForm(Form $form, $data)
{
$doc = $this->app->getDocument();
if (!($this->app->isClient('administrator')) || ($doc->getType() != 'html')) return;
$testURL = 'index.php?option=com_tags&view=tag&id[0]=2&types[0]=1&Itemid=120';
$noticeMsg = 'Routed URL: '.ROUTE::link('site', $testURL);
$this->app->enqueueMessage($noticeMsg, 'notice');
}
For the same URL, ROUTE::link('site', $testURL)
must returns same results in Front-end and Back-end.
In my test ROUTE::link('site', $testURL)
returns
/joomla5/index.php?option=com_tags&view=tag&id[0]=2&types[0]=1&Itemid=120
in Back-end and
/joomla5/index.php?option=com_tags&view=tag&id[0]=2&types[0]=1&Itemid=123
in Front-end.
As you can see, Front-end results link to the wrong Itemid (Compact List of Tagged Items)
Ubuntu 22.04.4
PHP 8.1.2
MariaDB 10.6.16
Apache/2.4.52
Joomla! 5.0.3 Stable [ Kuboresha ]
Joomla Backward Compatibility Plugin Disabled
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
Without Itemid, both results are wrong.
It results
index.php?option=com_tags&view=tag&id[0]=2&types[0]=1&Itemid=123
for the front-end and for the back-end.
The page where it is executed makes no difference. I get the same result whether it is called from "123" or from other pages.
EDIT:
Sorry, If the article is run on pages other than the article itself, it works... with the full address (Itemid=120 too).
If I run without Itemid it is wrong in all pages.
Could you do me the favor of running your test again without the &Itemid=120 at the end of your input? I agree, that it should behave identically, but that parameter shouldn't be there to begin with. The other thing is: on which page did you run this? For the frontend, the broken tag router might give different results when called from the menu item 123 itself.