[symfony-users] sfValidatorDoctrineUnique doesn't work when only defined in BaseForm?

2010-04-10 Thread godbout
Hi there!

I have a very simple thing to do: allowing visitors to register their
email for a newsletter.
The email field is defined as unique in the db, and Doctrine created
me the BaseForm with the following code:...

[code]$this->validatorSchema->setPostValidator(
  new sfValidatorDoctrineUnique(array('model' => 'Subscriber',
'column' => array('email')))
);
[/code]

...which is exactly what I want. But it didn't work until I copy/
pasted exactly the same code in my NewsletterForm.

Any explanation for that?
My NewsletterForm doesn't contain much, but it redefined the email
field validator from ValidatorString to ValidatorEmail. Would that
cause the problem? I'm still surprised.

Let me know if you have an idea ;-)

Guill

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@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

To unsubscribe, reply using "remove me" as the subject.


Re: [symfony-users] sfValidatorDoctrineUnique doesn't work when only defined in BaseForm?

2010-04-11 Thread Alan Bem
Aren't you talking about two different Forms? It seems that first
post-validator comes from (Base)SubscriberForm, but you complaint about
NewsletterForm.
Is there inheritance relationship beetween them?

Cheers

On Sat, Apr 10, 2010 at 5:05 PM, godbout wrote:

> Hi there!
>
> I have a very simple thing to do: allowing visitors to register their
> email for a newsletter.
> The email field is defined as unique in the db, and Doctrine created
> me the BaseForm with the following code:...
>
> [code]$this->validatorSchema->setPostValidator(
>  new sfValidatorDoctrineUnique(array('model' => 'Subscriber',
> 'column' => array('email')))
>);
> [/code]
>
> ...which is exactly what I want. But it didn't work until I copy/
> pasted exactly the same code in my NewsletterForm.
>
> Any explanation for that?
> My NewsletterForm doesn't contain much, but it redefined the email
> field validator from ValidatorString to ValidatorEmail. Would that
> cause the problem? I'm still surprised.
>
> Let me know if you have an idea ;-)
>
> Guill
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@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
>
> To unsubscribe, reply using "remove me" as the subject.
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@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