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
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