-- Borje <[EMAIL PROTECTED]> wrote
(on Wednesday, 03 December 2008, 06:26 AM -0800):
> Matthew Weier O'Phinney-3 wrote:
> > 
> > -- Samuel Verdier <[EMAIL PROTECTED]> wrote
> > (on Tuesday, 05 August 2008, 03:43 PM +0200):
> >> In use addError('test');
> >> 
> >> And : $form->isValid($formData); retour true.
> >> 
> >> Is this normal?
> > 
> > Yes. The use case for addError() is to add an error message to the
> > element or form. isValid() is for validating the various form elements.
> > Adding an error message is not indicative of the actual validations
> > performed.
> > 
> This I find rather confusing. Zend_Form_Element::addError() has the
> following description: "Add an error message and mark element as failed
> validation". This implies that Zend_Form_Element::addError() also sets the
> element to fail validation. The method Zend_Form_Element::addErrorMessage()
> on the other hand has the following description: "Add a custom error message
> to return in the event of failed validation" Which seems to be a more
> accurate description of what you explained.
> On another note, Zend_Form::addError() and Zend_Form::addErrorMessage() has
> the same descriptions with the word "element" in them, which makes the
> matter even more confusing.
> And to make matters even a bit worse, Zend_Form_Element::addError() calls
> Zend_Form_Element::markAsError() which has the following description: "Mark
> the element as being in a failed validation state".
> This leads me to believe that addError() was meant to actually make
> validation fail, but that doesn't seem to be the case.

Hmm...  you're right, it doesn't right now, but it likely should. Care
to file an issue report?

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to