Quantcast

invalidFields() returns duplicates?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

invalidFields() returns duplicates?

Shahruk Khan
array(
'email' => array(
(int) 0 => 'You must enter a proper email address.',
(int) 1 => 'You must enter a proper email address.'
)
)

I get this response when all I have is one field called email in $this->request->data. Any help please?

--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: invalidFields() returns duplicates?

euromark
you need to show us some code
but I bet that you call save/validate + invalidate or something like that
it just adds the same message twice to the error message stack


Am Samstag, 11. August 2012 18:26:09 UTC+2 schrieb Shahruk Khan:
array(
'email' => array(
(int) 0 => 'You must enter a proper email address.',
(int) 1 => 'You must enter a proper email address.'
)
)

I get this response when all I have is one field called email in $this->request->data. Any help please?

--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: invalidFields() returns duplicates?

Điển vũ
In reply to this post by Shahruk Khan

https://cakephp.lighthouseapp.com/projects/42648/tickets/2597-model-invalidfields-add-validation-messages-each-time-it-s-called

this answer from Mark-story:

Yes, this is how it works. Since you are using lower level methods the validationErrors are not reset. You should use create() + save() to automatically flush errors. Or if you just want errors, you should access the Models->validationErrors property instead of calling invalidFields().


On Saturday, August 11, 2012 11:26:09 PM UTC+7, Shahruk Khan wrote:
array(
'email' => array(
(int) 0 => 'You must enter a proper email address.',
(int) 1 => 'You must enter a proper email address.'
)
)

I get this response when all I have is one field called email in $this->request->data. Any help please?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Loading...