'atomic' => false
and
validate => only
can result in unexpected results^^
I had to find out the hard way

you cannot simply use if()
in this case you need some hack like I came up with

if (CommonComponent::logicalAnd($this->Model->saveAll(...,
array('validate'=>'only'))))

:)

On 14 Apr., 02:28, francky06l <[email protected]> wrote:
> Do you use saveAll on innoDb tables ? If not, actually set option
> 'atomic' => false.
> Try first save with options validate => only and a second saveAll with
> validate false.
>
> On Apr 13, 12:06 am, Jeff <[email protected]> wrote:
>
>
>
>
>
>
>
> > I've got an odd problem.  I have tables/models names and projects with
> > join table names_projects.  I have an isUnique rule on the name field
> > in the names table so that I don't have repeat entries.  When I
> > perform my saveAll with a new name and the validation in place I get
> > the error:
>
> > Notice (8): Undefined index: NamesProject [CORE/cake/libs/model/
> > model.php, line 1701]
>
> > And a name_id doesn't get passed to my join table insert.  However,
> > when I remove the isUnique validation on the name model, I don't get
> > an error and my insert has the last inserted name_id.  With the
> > validation in place, the validation works, so everything seems like
> > it's set up fine.  Any ideas on what's going on?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to