? Success

User tests: Successful: Unsuccessful:

avatar JoeJoomlaCoder
JoeJoomlaCoder
6 Nov 2016

Pull Request for Issue #12787

Summary of Changes

Issue is due to the change at root/libraries/cms/application/site.php line 355 from:
$temp = new Registry; $temp->loadString($menu->params);

to

$temp = new Registry($menu->params);

Testing Instructions

Test the menu item params override no more taking effect in com_content, etc

Documentation Changes Required

Steps to reproduce the issue

Use JApplicationSite getParams('com_mycomponent') method for a certain component in the frontend, having a valid routed menu item.

Expected result

All component params are merged with the specific menu item parameters in the same JRegistry object
If you have a menu item parameter 'myparam' and you call:
$registry = $this->app->getParams('com_mycomponent') ;

You always had:
$myParam = $registry->get('myparam');

Actual result

Menu item parameters are not merged as properties of the JRegistry object that can be obtained using the JRegistry 'get' method, but instead menu items parameters are all included in an array property named 'data'.
If you have a menu item parameter 'myparam' and you call:
$registry = $this->app->getParams('com_mycomponent') ;

You have:
$menuParameters = $registry->get('data');
$myParam = $menuParameters['myparam'];

System information (as much as possible)

Issue is due to the change at root/libraries/cms/application/site.php line 355 from:
$temp = new Registry; $temp->loadString($menu->params);

to

$temp = new Registry($menu->params);

Currently menu item params are not applied in J3.7 at all. Just test creating for example a menu item for a single article view.

avatar JoeJoomlaCoder JoeJoomlaCoder - open - 6 Nov 2016
avatar JoeJoomlaCoder JoeJoomlaCoder - change - 6 Nov 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Nov 2016
Category Libraries
avatar mbabker
mbabker - comment - 6 Nov 2016

If $menu->params is already a Registry instance, there should be no requirement at all to create another Registry instance, load a string representation of that Registry into it, THEN merge that into a Registry. While this might "fix" the issue, this doesn't seem valid to me at all. If you can't merge Registry A to Registry B without an intermediary Registry then we have major coding issues.

avatar JoeJoomlaCoder JoeJoomlaCoder - change - 6 Nov 2016
The description was changed
avatar JoeJoomlaCoder JoeJoomlaCoder - edited - 6 Nov 2016
avatar Bakual
Bakual - comment - 6 Nov 2016

Actually, that is fixed already in staging with #12557.
What you're describing was the code and behaviour before that PR.

Can you please verify that the issue still exists with current staging?

avatar joeforjoomla
joeforjoomla - comment - 6 Nov 2016

I confirm that using the current staging with the following code:
$params[$hash]->merge($temp);

everything is back to normal.

avatar Bakual
Bakual - comment - 7 Nov 2016

Closing as issue is solved elsewhere

avatar Bakual Bakual - change - 7 Nov 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-11-07 07:13:52
Closed_By Bakual
avatar Bakual Bakual - close - 7 Nov 2016
avatar Bakual Bakual - close - 7 Nov 2016
avatar brianteeman
brianteeman - comment - 7 Nov 2016

Glad it's resolved.

Add a Comment

Login with GitHub to post a comment