Skip to content

Commit

Permalink
Effectively reverting changes made in
Browse files Browse the repository at this point in the history
[190066f] which caused conditions using
a falsey values to be removed.
  • Loading branch information
markstory committed Mar 16, 2010
1 parent 661fcd3 commit 01a5738
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cake/libs/model/model.php
Expand Up @@ -1370,10 +1370,12 @@ function __saveMulti($joined, $id) {
} }


if ($this->hasAndBelongsToMany[$assoc]['unique']) { if ($this->hasAndBelongsToMany[$assoc]['unique']) {
$conditions = array_filter(array_merge( $conditions = array(
array($join . '.' . $this->hasAndBelongsToMany[$assoc]['foreignKey'] => $id), $join . '.' . $this->hasAndBelongsToMany[$assoc]['foreignKey'] => $id
(array)$this->hasAndBelongsToMany[$assoc]['conditions'] );
)); if (!empty($this->hasAndBelongsToMany[$assoc]['conditions'])) {
$conditions = array_merge($conditions, (array)$this->hasAndBelongsToMany[$assoc]['conditions']);
}
$links = $this->{$join}->find('all', array( $links = $this->{$join}->find('all', array(
'conditions' => $conditions, 'conditions' => $conditions,
'recursive' => empty($this->hasAndBelongsToMany[$assoc]['conditions']) ? -1 : 0, 'recursive' => empty($this->hasAndBelongsToMany[$assoc]['conditions']) ? -1 : 0,
Expand Down

0 comments on commit 01a5738

Please sign in to comment.