ZF-7383: Captcha element doesn't bother if it's required or not


Method isValid() in Zend_Form_Element_Captcha returns false in case of empty value although I have set it not to be required and allow empty.


Isn't the expected behaviour?

Why would you want to make the CAPTCHA optional anyway?

If I want to add it but keep it hidden when it's not yet required. (It's also set required in ZF quickstart although it doesn't seem to matter.)

shouldn't you use setIgnore() then?

setIgnore() won't work either.

In my opinion captcha element is a form element like any other element, so why shouldn't the same options like required etc. do the same things in captcha. And if you have noticed, the required option is also used for captcha in the part of ZF quickstart where Zend_Form is introduced. Obviously it's meant that you can decide if captcha is required or not (meant to inherit the basic functionality of the Zend_Form_Element).

I tried to hide captcha by using clearDecorators() for captcha element. It didn't work, because ViewHelper decorators wasn't removed.

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.