Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Effectively reverting changes made in

[190066f] which caused conditions using
a falsey values to be removed.
  • Loading branch information...
commit 01a5738f3c7f8553d8203eb565c08beba6e79ca0 1 parent 661fcd3
@markstory markstory authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 cake/libs/model/model.php
View
10 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,
Please sign in to comment.
Something went wrong with that request. Please try again.