Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call parent constructor after the element decorators have been set #109

Open
wants to merge 1 commit into
base: bootstrap3
Choose a base branch
from

Conversation

jimmykane
Copy link

This fixes issue #102

@jimmykane
Copy link
Author

To be more specific the issue realates to how Zend_Form is using setElementDecorators

 /**
     * Set all element decorators as specified
     *
     * @param  array $decorators
     * @param  array|null $elements Specific elements to decorate or exclude from decoration
     * @param  bool $include Whether $elements is an inclusion or exclusion list
     * @return Zend_Form
     */
    public function setElementDecorators(array $decorators, array $elements = null, $include = true)
    {
        if (is_array($elements)) {
            if ($include) {
                $elementObjs = array();
                foreach ($elements as $name) {
                    if (null !== ($element = $this->getElement($name))) {
                        $elementObjs[] = $element;
                    }
                }
            } else {
                $elementObjs = $this->getElements();
                foreach ($elements as $name) {
                    if (array_key_exists($name, $elementObjs)) {
                        unset($elementObjs[$name]);
                    }
                }
            }
        } else {
            $elementObjs = $this->getElements();
        }

        foreach ($elementObjs as $element) {
            $element->setDecorators($decorators);
        }

        $this->_elementDecorators = $decorators;

        return $this;
    }

Basically if you notice this has a double purpose.

@jimmykane
Copy link
Author

Anyone there on this ?

@jimmykane
Copy link
Author

It would be nice if it's merged because we are using ZFTB3 as an dependency installed via composer.

@jakejohns
Copy link

this does appear to fix the issue. seems like it should be pulled unless theres some other implication I'm missing.

@jimmykane
Copy link
Author

Sorry wrong reading....

@twisty
Copy link

twisty commented May 18, 2014

Hi, does anyone at @Emagister have an opinion on this PR?

@theUniC
Copy link
Contributor

theUniC commented May 18, 2014

Ping @eberhm

Can you merge the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants