From 4653c10a75ab7f9b46b2a47907603dbafd2fae96 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Sun, 21 May 2023 12:06:16 +0300 Subject: [PATCH] Fix #19743: Non-associative array values in AR weren't considered dirty when reordered --- CHANGELOG.md | 1 + db/BaseActiveRecord.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7caa3e360..a9398b9a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Yii Framework 2 Change Log 2.0.48 under development ------------------------ +- Bug #19743: Non-associative array values in AR weren't considered dirty when reordered (samdark) - Bug #19807: Fix REST serializer not using `serializeModel()` when working with array of models (zucha) - Enh #19766: Add support for PHP generators to JSON helper (vladis84) - Bug #19683: Updated `framework\mimeType.php` to the actual value. Fix typo in `build/controllers/MimeTypeController.php` (DeryabinSergey) diff --git a/db/BaseActiveRecord.php b/db/BaseActiveRecord.php index 3e0dd316e..06e6d7460 100644 --- a/db/BaseActiveRecord.php +++ b/db/BaseActiveRecord.php @@ -1763,7 +1763,7 @@ private function setRelationDependencies($name, $relation, $viaRelationName = nu */ private function isValueDifferent($newValue, $oldValue) { - if (is_array($newValue) && is_array($oldValue)) { + if (is_array($newValue) && is_array($oldValue) && !ArrayHelper::isAssociative($oldValue)) { $newValue = ArrayHelper::recursiveSort($newValue); $oldValue = ArrayHelper::recursiveSort($oldValue); }