Skip to content

Commit

Permalink
Fix #19743: Non-associative array values in AR weren't considered dir…
Browse files Browse the repository at this point in the history
…ty when reordered
  • Loading branch information
samdark committed May 21, 2023
1 parent 301a1cf commit a8e83ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion framework/db/BaseActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a8e83ab

Please sign in to comment.