Skip to content
Permalink
Browse files

Effectively reverting changes made in

[190066f] which caused conditions using
a falsey values to be removed.
  • Loading branch information...
markstory committed Mar 16, 2010
1 parent 661fcd3 commit 01a5738f3c7f8553d8203eb565c08beba6e79ca0
Showing with 6 additions and 4 deletions.
  1. +6 −4 cake/libs/model/model.php
@@ -1370,10 +1370,12 @@ function __saveMulti($joined, $id) {
}
if ($this->hasAndBelongsToMany[$assoc]['unique']) {
$conditions = array_filter(array_merge(
array($join . '.' . $this->hasAndBelongsToMany[$assoc]['foreignKey'] => $id),
(array)$this->hasAndBelongsToMany[$assoc]['conditions']
));
$conditions = array(
$join . '.' . $this->hasAndBelongsToMany[$assoc]['foreignKey'] => $id
);
if (!empty($this->hasAndBelongsToMany[$assoc]['conditions'])) {
$conditions = array_merge($conditions, (array)$this->hasAndBelongsToMany[$assoc]['conditions']);
}
$links = $this->{$join}->find('all', array(
'conditions' => $conditions,
'recursive' => empty($this->hasAndBelongsToMany[$assoc]['conditions']) ? -1 : 0,

0 comments on commit 01a5738

Please sign in to comment.
You can’t perform that action at this time.