Merge branch 'master' into inflextor_fixes

This commit is contained in:
Alexander Makarov
2021-05-06 13:07:31 +03:00
committed by GitHub
2 changed files with 6 additions and 6 deletions

View File

@ -1,10 +1,10 @@
Yii Framework 2 Change Log Yii Framework 2 Change Log
========================== ==========================
2.0.43 under development 2.0.42.1 under development
------------------------ --------------------------
- no changes in this release. - Bug #18634: Fix `yii\db\BaseActiveRecord::unlink()` and `unlinkAll()` to omit condition for `on` property when it doesn't exist (bizley)
2.0.42 May 05, 2021 2.0.42 May 05, 2021

View File

@ -1413,7 +1413,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
foreach (array_keys($columns) as $a) { foreach (array_keys($columns) as $a) {
$nulls[$a] = null; $nulls[$a] = null;
} }
if ($viaRelation->on !== null) { if (property_exists($viaRelation, 'on') && $viaRelation->on !== null) {
$columns = ['and', $columns, $viaRelation->on]; $columns = ['and', $columns, $viaRelation->on];
} }
if (is_array($relation->via)) { if (is_array($relation->via)) {
@ -1513,7 +1513,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
if (!empty($viaRelation->where)) { if (!empty($viaRelation->where)) {
$condition = ['and', $condition, $viaRelation->where]; $condition = ['and', $condition, $viaRelation->where];
} }
if (!empty($viaRelation->on)) { if (property_exists($viaRelation, 'on') && !empty($viaRelation->on)) {
$condition = ['and', $condition, $viaRelation->on]; $condition = ['and', $condition, $viaRelation->on];
} }
if (is_array($relation->via)) { if (is_array($relation->via)) {
@ -1550,7 +1550,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
if (!empty($relation->where)) { if (!empty($relation->where)) {
$condition = ['and', $condition, $relation->where]; $condition = ['and', $condition, $relation->where];
} }
if (!empty($relation->on)) { if (property_exists($relation, 'on') && !empty($relation->on)) {
$condition = ['and', $condition, $relation->on]; $condition = ['and', $condition, $relation->on];
} }
if ($delete) { if ($delete) {