Issues

ZF-3254: disableLoadDefaultDecorators is ignored for DisplayGroup

Issue Type: Bug Created: 2008-05-13T07:33:05.000+0000 Last Updated: 2008-09-02T10:39:45.000+0000 Status: Resolved Fix version(s): - 1.6.0 (02/Sep/08)

Reporter: Vladimir Michailenko (mich) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form

Related issues: Attachments:

Description

<pre class="highlight">
$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:

<pre class="highlight">
        $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

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

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

Comments

Posted by Wil Sinclair (wil) on 2008-06-08T06:04:03.000+0000

Please evaluate/fix as necessary.

Posted by Matthew Weier O'Phinney (matthew) on 2008-08-05T08:21:50.000+0000

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

Posted by Wil Sinclair (wil) on 2008-09-02T10:39:45.000+0000

Updating for the 1.6.0 release.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts