?
avatar babsgosgens
babsgosgens
3 Dec 2013

I was plucking my hair trying to figure out why an alternative layout for a categories view wasn't loaded.

After rechecking my code for the zillionst time I decided to track down the issue and I found it.

The problem is first introduced in line 638 of JControllerLegacy:

$viewLayout = $this->input->get('layout', 'default');

By default, the input is filtered with the CMD filter - which removes the ':' from the layout parameter string. My layout parameter (mytemplate:somealternatelayout) was being filtered to 'mytemplatesomealternatelayout' resulting in my layout being disregarded and Joomla falling back to the default.

I haven't included a patch because effectively, this can be fixed in two places:

in JControllerLegacy, simply adding a RAW or STRING filter,
or in JFilterInput, altering the CMD filter.

I am not sure if either approach has any security draw backs.

I haven't created a tracker item because there seem to be multiple active items relating to this issue.

Let me know what you decide on, if you want I can issue a PR - just tell me what trackerno to refer to.

Thanks Babs

avatar babsgosgens babsgosgens - open - 3 Dec 2013
avatar Bakual
Bakual - comment - 3 Dec 2013

Can you test this PR? #1553

avatar babsgosgens
babsgosgens - comment - 3 Dec 2013

Hey, you have already fixed this. Is this not in the staging branch yet? Your fix works of course, as suggested above.

avatar zero-24 zero-24 - close - 3 Dec 2013
avatar babsgosgens
babsgosgens - comment - 3 Dec 2013

Closing - this is an exact duplicate of #1553

Why has this PR not been accepted yet?

avatar babsgosgens babsgosgens - change - 3 Dec 2013
The description was changed
Description <p>I was plucking my hair trying to figure out why an alternative layout for a categories view wasn't loaded.</p> <p>After rechecking my code for the zillionst time I decided to track down the issue and I found it.</p> <p>The problem is first introduced in line 638 of JControllerLegacy:</p> <p>$viewLayout = $this-&gt;input-&gt;get('layout', 'default');</p> <p>By default, the input is filtered with the CMD filter - which removes the ':' from the layout parameter string. My layout parameter (mytemplate:somealternatelayout) was being filtered to 'mytemplatesomealternatelayout' resulting in my layout being disregarded and Joomla falling back to the default.</p> <p>I haven't included a patch because effectively, this can be fixed in two places:</p> <p>in JControllerLegacy, simply adding a RAW or STRING filter,<br> or in JFilterInput, altering the CMD filter.</p> <p>I am not sure if either approach has any security draw backs.</p> <p>I haven't created a tracker item because there seem to be multiple active items relating to this issue.</p> <p>I was plucking my hair trying to figure out why an alternative layout for a categories view wasn't loaded.</p> <p>After rechecking my code for the zillionst time I decided to track down the issue and I found it.</p> <p>The problem is first introduced in line 638 of JControllerLegacy:</p> <p>$viewLayout = $this-&gt;input-&gt;get('layout', 'default');</p> <p>By default, the input is filtered with the CMD filter - which removes the ':' from the layout parameter string. My layout parameter (mytemplate:somealternatelayout) was being filtered to 'mytemplatesomealternatelayout' resulting in my layout being disregarded and Joomla falling back to the default.</p> <p>I haven't included a patch because effectively, this can be fixed in two places:</p> <p>in JControllerLegacy, simply adding a RAW or STRING filter,<br> or in JFilterInput, altering the CMD filter.</p> <p>I am not sure if either approach has any security draw backs.</p> <p>I haven't created a tracker item because there seem to be multiple active items relating to this issue.</p> <p>Let me know what you decide on, if you want I can issue a PR - just tell me what trackerno to refer to.</p> <p>Thanks Babs</p>
Status New Closed
Closed_Date 0000-00-00 00:00:00 2013-12-03 09:53:35
avatar babsgosgens babsgosgens - close - 3 Dec 2013
avatar Bakual
Bakual - comment - 3 Dec 2013

Because unfortunately nobody cared to test it :disappointed:
We usually need two good tests logged in the associated tracker item. If nobody cares to test, nothing will get fixed.

So you would be a big help if you can test it and mark a successful test in the tracker.

avatar babsgosgens
babsgosgens - comment - 3 Dec 2013

Right. :(

Where can I find instructions for testing? Or can you help me out Thomas? I'm om Skype if you have time... (crossinghippos)

avatar Bakual
Bakual - comment - 3 Dec 2013

If you look at http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31494, you'll see some testing instructions. Basically since you already know how to reproduce the error, just apply the patch and try again.
If you have time also test some other things related to layouts to make sure nothing broke. But if you can just confirm that the issue is solved with this patch, that would be a big help already.

To apply the patch, the easiest thing is to use the Patchtester component. See http://docs.joomla.org/Component_Patchtester_for_Testers

I'm usually on skype as well (bakual) when I'm at home. But depending on your timezone (I'm from Europe) that could be incompatible :)

avatar babsgosgens
babsgosgens - comment - 3 Dec 2013

Done.

avatar Bakual
Bakual - comment - 3 Dec 2013

Thanks!

avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment