I have custom coded Joomla v1.5 component. In administrator zone I change its parameters, but when I taking param values in my code I get only default values, but not the new as I set in components admin zone params window.
global $option;
$params = &JComponentHelper::getParams( $option );
print_r($params);
The output looks like this:
JParameter Object
(
[_raw] => param_1=This is changed value of the param 1
param_2=20
param_3=This is changed value of the param 3
[_xml] =>
[_elements] => Array
(
)
[_elementPath] => Array
(
[0] => /home/x/domains/xyz.com/public_html/libraries/joomla/html/parameter/element
)
[_defaultNameSpace] => _default
[_registry] => Array
(
[_default] => Array
(
[data] => stdClass Object
(
[param_1] => some default value 1
[param_2] => 10
[param_3] => some default value 3
)
)
)
[_errors] => Array
(
)
)
How you in output, param raw data changes, but the data field does not. So what’s the problem ? Any ideas ?
I’ve found out the problem. So when I create a menu link to my component view, it duplicates the component parameters in menu item params list. So it overrides the main component parameters. That’s why if I change param value in components param window(in admin zone), I get only param values that are in menu items window. Also found some more information about it in Joomla forum: http://forum.joomla.org/viewtopic.php?f=304&t=485837