No Code Attached Yet bug
avatar luX0r-reload
luX0r-reload
18 Mar 2024

Steps to reproduce the issue

  1. Create a tag "PC".
  2. Create one article and tag it to "PC".
  3. Create a menu item type "Tagged Items" and set tag to "PC" and Content Type do "Article".
  4. Create a menu item type "Compact List of Tagged Items" and set tag to "PC" and Content Type do "Article".
  5. Turn SEF off in the Joomla global settings. Just for testing, but it does not work even with SEF on.

menu-items-list

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');
}

Expected result

For the same URL, ROUTE::link('site', $testURL) must returns same results in Front-end and Back-end.

Actual result

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)

System information (as much as possible)

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

Additional comments

avatar luX0r-reload luX0r-reload - open - 18 Mar 2024
avatar joomla-cms-bot joomla-cms-bot - change - 18 Mar 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Mar 2024
avatar Hackwar Hackwar - change - 24 Mar 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 24 Mar 2024
avatar Hackwar
Hackwar - comment - 6 Aug 2024

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.

avatar luX0r-reload
luX0r-reload - comment - 6 Aug 2024

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.

Add a Comment

Login with GitHub to post a comment