ZF-3254: disableLoadDefaultDecorators is ignored for DisplayGroup

Description


$this->addDisplayGroup(array('number', 'prefix'), 'phone', array(
    'disableLoadDefaultDecorators' => true,
));

Default decorators will be loaded anyway...

Pass $option to Zend_Form_DisplayGroup::__construct() instead of calling Zend_Form_DisplayGroup::setOption(), because Zend_Form_DisplayGroup::loadDefaultDecorators is called at constructor... So:


        $this->_displayGroups[$name] = new $class(
            $name, 
            $this->getPluginLoader(self::DECORATOR)
        );

        if (!empty($this->_displayGroupPrefixPaths)) {
            $this->_displayGroups[$name]->addPrefixPaths($this->_displayGroupPrefixPaths);
        }

        if (is_array($options)) {
            $this->_displayGroups[$name]->setOptions($options);
        } elseif ($options instanceof Zend_Config) {
            $this->_displayGroups[$name]->setConfig($options);
        }

replace with


        $this->_displayGroups[$name] = new $class(
            $name, 
            $this->getPluginLoader(self::DECORATOR),
            $options
        );

        if (!empty($this->_displayGroupPrefixPaths)) {
            $this->_displayGroups[$name]->addPrefixPaths($this->_displayGroupPrefixPaths);
        }

Comments

Please evaluate/fix as necessary.

Patched in trunk with r10679 and in 1.6 release branch with r10680.

Updating for the 1.6.0 release.