Issues

ZF-9712: Zend_Form_Decorator_Captcha_Word : captchaOptions attribute is not removed in the render() method

Issue Type: Sub-task Created: 2010-04-19T11:45:57.000+0000 Last Updated: 2010-05-26T13:35:33.000+0000 Status: Resolved Fix version(s): - 1.10.5 (26/May/10)

Reporter: coba (coba) Assignee: Christian Albrecht (alab) Tags: - Zend_Form

Related issues: Attachments:

Description

Hello,

Zend_Form_Decorator_Captcha_Word must to remove 'captchaOptions' from attributes of element before to pass it to formHidden and formText view helpers.

see ZF-7285 too

A way to remove it :

<pre class="literal"> 
public function render($content)
{
        $element = $this->getElement();
        $view    = $element->getView();
        if (null === $view) {
            return $content;
        }

        $name = $element->getFullyQualifiedName();

        $hiddenName = $name . '[id]';
        $textName   = $name . '[input]';

        $label = $element->getDecorator("Label");
        if($label) {
            $label->setOption("id", $element->getId()."-input");
        }

        $placement = $this->getPlacement();
        $separator = $this->getSeparator();

        /**
          *
          * Remove captchaOptions from attributes
          *
          */
         $attribs = $element->getAttribs();
    
         if (array_key_exists('captchaOptions', $attribs))
         {
           unset($attribs['captchaOptions']);
         }

        $hidden = $view->formHidden($hiddenName, $element->getValue(), $attribs);
        $text   = $view->formText($textName, '', $attribs);
        switch ($placement) {
            case 'PREPEND':
                $content = $hidden . $separator . $text . $separator . $content;
                break;
            case 'APPEND':
            default:
                $content = $content . $separator . $hidden . $separator . $text;
        }
        return $content;
}

Comments

Posted by Christian Albrecht (alab) on 2010-04-19T12:37:31.000+0000

Changing Priority to minor.

Posted by coba (coba) on 2010-05-20T09:42:23.000+0000

Can you corrige this bug ? Or else add me on svn I will to correct it.

Posted by Christian Albrecht (alab) on 2010-05-24T11:18:20.000+0000

Fixed in r22274 and merged into 1.10 release branch

Posted by coba (coba) on 2010-05-25T03:37:02.000+0000

thanks you

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