Fixes #15122: Fixed yii\db\Command::getRawSql() to properly replace expressions

This commit is contained in:
hiscaler
2017-11-08 17:00:56 +08:00
committed by Alexander Makarov
parent acce1db53b
commit d32b80eec9
2 changed files with 2 additions and 1 deletions

View File

@ -130,6 +130,7 @@ Yii Framework 2 Change Log
- Bug #14773: Fixed `yii\widgets\ActiveField::$options` does not support 'class' option in array format (klimov-paul)
- Bug #14902: Fixed PHP notice in `yii\web\MultipartFormDataParser` (olimsaidov)
- Bug #14921: Fixed bug with replacing numeric keys in `yii\helpers\Url::current()` (rob006)
- Bug #15122: Fixed bug with sql error if params has expression in `yii\db\Command::getRawSql()` (hiscaler)
- Enh #4479: Implemented REST filters (klimov-paul)
- Enh #4495: Added closure support in `yii\i18n\Formatter` (developeruz)
- Enh #5786: Allowed to use custom constructors in ActiveRecord-based classes (ElisDN, klimov-paul)

View File

@ -211,7 +211,7 @@ class Command extends Component
$params[$name] = ($value ? 'TRUE' : 'FALSE');
} elseif ($value === null) {
$params[$name] = 'NULL';
} elseif (!is_object($value) && !is_resource($value)) {
} elseif ((!is_object($value) && !is_resource($value)) || $value instanceof Expression) {
$params[$name] = $value;
}
}