Zend Framework

Zend_Config_Writer_Ini jumbling sections

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.8
  • Fix Version/s: 1.10.8
  • Component/s: Zend_Config_Writer
  • Labels:
    None

Description

The issue is with Zend_Config_Writer_Ini. When you build a Zend_Config object and add data elements to it, the writer writes them out to the file in the order they were added. This creates problems when you add sections, then add more root level data to the config afterwards. For example, creating an object like this:
$schema = new Zend_Config(array(
'menuName' => $this->menuName,
'tableName' => $this->tableName,
'fields' => array(),
'type' => $this->type,
'order' => $this->order
), true);
The fields section is build later (i have the code available but i don't think it matters) but the basic idea is to have a [fields] section with various elements beneath it. When Zend_Config_Writer_Ini writes this out to the file, it will print out like this:

menuName = "Multi Record"
tableName = "multi_record"
[fields]
data = "data"

type = "multi"
order = 1

This puts `type` and `order` under the [fields] section, when it should be up next to tableName and menuName, which is under the root section. I feel the solution would be to process seperate sections last, so all root keys are not written at the bottom like this changing their context.

Issue Links

Activity

Hide
Jan Pieper added a comment -

Fixed in r21983.

Show
Jan Pieper added a comment - Fixed in r21983.
Hide
Rob Allen added a comment -

Jan,

You've marked this as fixed in 1.10.4, but it doesn't seem to have been merged from trunk to the branch?

Is there a reason it wasn't merged?

Show
Rob Allen added a comment - Jan, You've marked this as fixed in 1.10.4, but it doesn't seem to have been merged from trunk to the branch? Is there a reason it wasn't merged?
Hide
Jan Pieper added a comment -

I only commited my changes to trunk but there shouldn't be any problems to not merge them to the mentioned branch or a newer one.

Show
Jan Pieper added a comment - I only commited my changes to trunk but there shouldn't be any problems to not merge them to the mentioned branch or a newer one.
Hide
Ramon Henrique Ornelas added a comment -

Applied to branch release-1.10 in r22869.

Show
Ramon Henrique Ornelas added a comment - Applied to branch release-1.10 in r22869.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: