diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 1e473f4..93be059 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -7,6 +7,7 @@ Yii Framework 2 Change Log - Enh #9989: ActiveForm now respects formtarget, formmethod and formenctype attributes of submit button (AnatolyRugalev) - Enh #12296: Added value validation to `yii\log\Target::setLevels()` (Mak-Di) - Enh #12073: Added the ability to suppress the generation of input hint when it is specified through `Model::attributeHints()` (PowerGamer1) +- Bug #11990: Fixed `yii\db\BaseActiveRecord::refresh()` may set incorrect `oldAttributes` values at some cases (only-victor) - Bug #12009: Do not render "for" field label attribute for active form RadioList and CheckboxList (shevchik87, samdark) - Bug #12068: Added missing 'LEVEL_PROFILE' for the syslog target (Mak-Di) - Bug #11461: Fixed migration tool error when create migrate with comma in defaultValue (pana1990, s-o-f) diff --git a/framework/db/BaseActiveRecord.php b/framework/db/BaseActiveRecord.php index 8de12e1..0e915fc 100644 --- a/framework/db/BaseActiveRecord.php +++ b/framework/db/BaseActiveRecord.php @@ -973,7 +973,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface foreach ($this->attributes() as $name) { $this->_attributes[$name] = isset($record->_attributes[$name]) ? $record->_attributes[$name] : null; } - $this->_oldAttributes = $this->_attributes; + $this->_oldAttributes = $record->_oldAttributes; $this->_related = []; $this->afterRefresh();