Issue Type: Bug Created: 2009-10-27T05:59:55.000+0000 Last Updated: 2009-11-19T12:08:50.000+0000 Status: Resolved Fix version(s): Reporter: John Lamb (olann) Assignee: Jan Pieper (jpieper) Tags: - Zend_Config
Related issues: Attachments:
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
<pre class="literal"> [first] user.login.elements.username.type = "text" [second] user.login.elements.password.type = "password"
load array of sections
<pre class="literal"> $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.
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...
Have you found an issue?
See the Overview section for more details.