ZF-8159: Zend_Config_Ini doesn't load multiple sections correctly
Description
If you pass an array of sections to Zend_Config_Ini the sections are merged using array_merge(). This is a problem when you are using the config to create a Zend_Form, as all the elements are under the "elements" key, so when they are merged you end up with only the elements from one of the sections.
Example: test.ini file
[first] user.login.elements.username.type = "text" [second] user.login.elements.password.type = "password"
load array of sections
$sections = array('first', 'second');
$config = new Zend_Config_Ini(CONFIG . 'test.ini', $sections);
$this->view->form = new Zend_Form($config->user->login);
Behaviour: only one form element displayed.
Changing line 152 of Zend/Config/Ini.php to use array_merge_recursive() fixes this for me.
Comments
Posted by John Lamb (olann) on 2009-10-30T12:23:55.000+0000
affects 1.9.5 too
Posted by Jan Pieper (jpieper) on 2009-11-19T11:46:39.000+0000
Fixed in r19056.
Posted by Jan Pieper (jpieper) on 2009-11-19T12:06:39.000+0000
Please use r19059 instead of r19059 because it contains a possible error in merging config data.
Posted by Jan Pieper (jpieper) on 2009-11-19T12:08:50.000+0000
...r19059 instead of r19056...