Bug fixed. saveAll() with validation option "only" or "first" works well with associated data. #209

Closed
wants to merge 1 commit into from

2 participants

@basuke

saveAll() did set null foreign key when it just validates.

For example, I've assigned numeric validation on the hasMany side model and validation did fail with this behavior.

$data = array(
    'Post' => array(
        'title' => 'Hello world',
    ), 
    'Keyword' => array(
        array(
            'word' => 'foo',
        ),
        array(
            'word' => 'bar',
        ),
        ...
    ),
);

I've changed this not to set foreign key when it just validation.

Yosuke Basuke Suzuki Bug fixed. saveAll with validation option "only" or "first" works wll.
saveAll() did set null foreign key when it just validates. I've
assigned numeric validation on the hasMany side model and validation
did fail with this behavior. I've changed this not to set foreign key
when it just validation.
842dbae
@ADmad
CakePHP member

Please don't make pull requests against master, do it against 1.3 or 2.0 branches.

@ADmad ADmad closed this Sep 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment