diff --git a/VERSION.txt b/VERSION.txt index dcb39f4ed..e7a454046 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -6,4 +6,4 @@ // +---------------------------------------------------------------------------------------------------+ // /////////////////////////////////////////////////////////////////////////////////////////////////////////// -0.10.7.1844 RC 2 \ No newline at end of file +0.10.7.1846 RC 2 \ No newline at end of file diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index f535e5548..9f5a48228 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -705,21 +705,21 @@ class DboSource extends DataSource $sql = 'SELECT '.join(', ', $this->fields($linkModel, $alias, $assocData['fields'])); $sql .= ' FROM '.$this->name($linkModel->table).' AS '. $this->name($alias); - $cond = $this->name($alias).'.'.$this->name($assocData['foreignKey']); - $cond .= '={$__cake_id__$}'; if (is_array($conditions)) { - $conditions[] = $cond; + $conditions[$alias.'.'.$assocData['foreignKey']] = '{$__cake_id__$}'; } else { + $cond = $this->name($alias).'.'.$this->name($assocData['foreignKey']); + $cond .= '={$__cake_id__$}'; + if (trim($conditions) != '') { $conditions .= ' AND '; } $conditions .= $cond; } - $sql .= $this->conditions($conditions); $sql .= $this->order($assocData['order']); } @@ -953,7 +953,12 @@ class DboSource extends DataSource } else { - $slashedValue = $this->value($value); + if (($value != '{$__cake_id__$}') && ($value != '{$__cake_foreignKey__$}')) + { + $value = $this->value($value); + } + + //$slashedValue = $this->value($value); //TODO: Remove the = below so LIKE and other compares can be used $data = $key . '='; if ($value === null) @@ -962,7 +967,7 @@ class DboSource extends DataSource } else { - $data .= $slashedValue; + $data .= $value; } } $out[] = $data;