No Code Attached Yet bug
avatar AndySDH
AndySDH
27 Jun 2023

Steps to reproduce the issue

Factory::getApplication()->input

contains the [layout] with value 'blog' even for an article, and not just for a category.

That is weird, because [layout] = 'blog' is a category parameter, not an article parameter.

The layout parameter should only appear in the Factory::getApplication()->input if a custom layout is set as an article level (with a dedicated menu item for that article layout). It should not be inherited from the category layout value, it makes no sense.

Expected result

When view=article, Factory::getApplication()->input should not inherit the [layout] variable from the category parameters.

Actual result

But currently the [layout] variable is inherited in the article view from the category parameters.

System information (as much as possible)

Joomla 4.3.2

avatar AndySDH AndySDH - open - 27 Jun 2023
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jun 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Jun 2023
avatar AndySDH AndySDH - change - 27 Jun 2023
The description was changed
avatar AndySDH AndySDH - edited - 27 Jun 2023
avatar AndySDH AndySDH - change - 27 Jun 2023
The description was changed
avatar AndySDH AndySDH - edited - 27 Jun 2023
avatar AndySDH AndySDH - change - 27 Jun 2023
The description was changed
avatar AndySDH AndySDH - edited - 27 Jun 2023
avatar chmst
chmst - comment - 28 Jun 2023

I don't understand your issue. Could you describe what exactly you are doing?

avatar AndySDH
AndySDH - comment - 28 Jun 2023

The issue is that when requesting Factory::getApplication()->input when in an article view, the [layout]="blog" variable is included in the array of variables (inherited from the category view).
It shouldn't, because [layout]="blog" is a category input var, not an article input var.

avatar AndySDH AndySDH - change - 29 Jun 2023
The description was changed
avatar AndySDH AndySDH - edited - 29 Jun 2023
avatar Hackwar Hackwar - change - 24 Aug 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 24 Aug 2023
avatar AndySDH
AndySDH - comment - 14 Oct 2026

Still an issue as of Joomla 6 by the way

avatar brianteeman
brianteeman - comment - 14 Oct 2026

is the only issue is that layout=blog appears in the input, with no adverse effect on the rendered page or other functionality. Changing core code could introduce more problems than it solves.

avatar Fedik
Fedik - comment - 14 Oct 2026

In theory it allows to have tmpl/article/blog.php (and the override for it in the template) for an Article detail for Category blog menu.
Currently there are fallback to default.php layout :

if ($this->_template === false) {
$filetofind = $this->_createFileName('', ['name' => 'default' . (isset($tpl) ? '_' . $tpl : $tpl)]);
$this->_template = Path::find($this->_path['template'], $filetofind);
}

Fixing requested issue can break someone site 😉

avatar AndySDH
AndySDH - comment - 14 Oct 2026

For example SEF extensions that generate URLs, eg. 4SEF, when they encounter URLs with layout=blog they store a duplicate URL for the same article. They said at the time they wouldn't fix it on their end "because its a Joomla issue"

avatar AndySDH
AndySDH - comment - 14 Oct 2026

7. In theory it allows to have tmpl/article/blog.php (and the override for it in the template) for an Article detail for Category blog menu.
Currently there are fallback to default.php layout :

if ($this->_template === false) {
$filetofind = $this->_createFileName('', ['name' => 'default' . (isset($tpl) ? '_' . $tpl : $tpl)]);
$this->_template = Path::find($this->_path['template'], $filetofind);
}

Fixing requested issue can break someone site 😉

Not true. In these cases the layout is never in the nonsef URL, it is computed automatically like the other params. An article nonsef never has a layout query string

avatar Fedik
Fedik - comment - 14 Oct 2026

I just pointing that this feature can be used by someone.
And it is actualy not a bad feature.

An article nonsef never has a layout query string

That sounds like we need to fix that, and add blog layout to articles inside category blog :)
This way we do not break anything.

I not sure what exactly 4SEF doing, but their URLs should be the same as in the Joomla menu, otherwise what the point of generating random URLs ;)

avatar Fedik
Fedik - comment - 14 Oct 2026

I just pointing that this feature can be used by someone.
And it is actualy not a bad feature.

An article nonsef never has a layout query string

That sounds like we need to fix that, and add blog layout to article URLs inside the category blog :)
This way we do not break anything.

I not sure what exactly 4SEF doing, but their URLs should be the same as in the Joomla menu, otherwise what the point of generating random URLs ;)

avatar Fedik
Fedik - comment - 14 Oct 2026

I just pointing that this feature can be used by someone.
And it is actualy not a bad feature.

An article nonsef never has a layout query string

That sounds like we need to fix that, and add blog layout to article URLs inside the category blog layout :)
This way we do not break anything.

I not sure what exactly 4SEF doing, but their URLs should be the same as in the Joomla menu, otherwise what the point of generating random URLs ;)

avatar AndySDH
AndySDH - comment - 14 Oct 2026
I just pointing that this feature can be used by someone.
And it is actualy not a bad feature.

The layout is used but it does not produce a different nonsef. Fixing this issue would not break the layout functionallity for articles, because it does not change the nonsef (it never has and it shouldn't).

That sounds like we need to fix that, and add blog layout to article URLs inside the category blog layout :)

What? Absolutely not. 'blog' is a category layout parameter. It has nothing to do with the article.

I not sure what exactly 4SEF doing, but their URLs should be the same as in the Joomla menu, otherwise what the point of generating random URLs ;)

I found the cause of the issue. It's the login module. When you have the login module enabled on the site, Joomla produces some nonsef URLs appending the faulty &layout=blog parameters to articles. It doesn't do it when normally building menu items. Really weird.

avatar brianteeman
brianteeman - comment - 14 Oct 2026

I found the cause of the issue. It's the login module. When you have the login module enabled on the site, Joomla produces some nonsef URLs appending the faulty &layout=blog parameters to articles. It doesn't do it when normally building menu items. Really weird.

I can not replicate that

avatar AndySDH
AndySDH - comment - 14 Oct 2026

You're right I can't reproduce it on a fresh Joomla install either. Super weird. I will let you know if I'm able to pinpoint the cause...

Add a Comment

Login with GitHub to post a comment