Make check more strict to respect existing queries

This commit is contained in:
Mark van Driel 2016-07-26 11:25:27 +02:00
parent d6e45131ad
commit c01525f2cc

View file

@ -438,8 +438,9 @@ class Mysql extends DboSource {
$alias = $joins = false;
}
$complexConditions = false;
$fields = array_keys($this->describe($model));
foreach ((array)$conditions as $key => $value) {
if (strpos($key, '.') !== false && strpos($key, $model->alias) === false) {
if (strpos($key, $model->alias) === false && !in_array($key, $fields, true)) {
$complexConditions = true;
break;
}