Add ArrayExpression support in related tables

This commit is contained in:
GHopper
2019-01-01 02:39:55 +03:00
parent 379a2002dd
commit a7771acd8d
2 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.16 under development 2.0.16 under development
------------------------ ------------------------
- Bug #16966: Fix ArrayExpression support in related tables (GHopperMSK)
- Bug #16028: Fix serialization of complex cache keys that contain non-UTF sequences (rugabarbo) - Bug #16028: Fix serialization of complex cache keys that contain non-UTF sequences (rugabarbo)
- Bug #16945: Fixed RBAC DbManager ruleName fetching on the case of PDO::ATTR_ORACLE_NULLS => PDO::NULL_TO_STRING (razonyang) - Bug #16945: Fixed RBAC DbManager ruleName fetching on the case of PDO::ATTR_ORACLE_NULLS => PDO::NULL_TO_STRING (razonyang)
- Bug #16081: Fixed composite IN using just one column (rugabarbo) - Bug #16081: Fixed composite IN using just one column (rugabarbo)

View File

@ -525,6 +525,8 @@ trait ActiveRelationTrait
if (($value = $model[$attribute]) !== null) { if (($value = $model[$attribute]) !== null) {
if (is_array($value)) { if (is_array($value)) {
$values = array_merge($values, $value); $values = array_merge($values, $value);
} elseif(($value instanceof ArrayExpression) && ($value->getDimension() === 1)) {
$values = array_merge($values, $value->getValue());
} else { } else {
$values[] = $value; $values[] = $value;
} }