hello,

just for info, the only way i found to get all errors compiled is
this :

{{{

// in lib/form/doctrine/BaseFormDoctrine.class.php
// or lib/form/BaseForm.class.php

    public function getErrors()
    {
        $errors = array();
        foreach ($this as $form_field)
        {
            if ($form_field->hasError())
            {
                $error_obj = $form_field->getError();
                if ($error_obj instanceof sfValidatorErrorSchema)
                {
                    foreach ($error_obj->getErrors() as $error)
                    {
                        $errors[$form_field->getName()][] = $error-
>getMessage();
                    }
                }
                else
                {
                    $errors[$form_field->getName()] = $error_obj-
>getMessage();
                }
            }
        }
        foreach ($this->getGlobalErrors() as $validator_error)
        {
            $errors[] = $validator_error->getMessage();
        }
        return $errors;
    }

}}}

It's useful for debbuging : just do a

<?php print_r($form->getErrors()) ?>

On 5 jan, 18:45, dantleech <dan.t.le...@gmail.com> wrote:
> In this case it was because widgets in the form were not being
> rendered .. but that's a different story :)
>
> On Jan 5, 5:16 pm, Gábor Fási <maerl...@gmail.com> wrote:
>
> > This usually means you forgot to echo the csrf secret field in your form.
>
> > On Tue, Jan 5, 2010 at 17:59, dantleech <dan.t.le...@gmail.com> wrote:
> > > The problem I have is that I have a form that has a global error -
> > > "There is an error with your form", but none of the fields are
> > > highlighted.
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to