Issues

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

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 :

 
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

Changing Priority to minor.

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

Fixed in r22274 and merged into 1.10 release branch

thanks you