Browse Source

Fixed `yii\db\BaseActiveRecord::refresh()` may set incorrect `oldAttributes` values at some cases

tags/2.0.10
Klimov Paul 8 years ago
parent
commit
4f7b1b0817
  1. 1
      framework/CHANGELOG.md
  2. 2
      framework/db/BaseActiveRecord.php

1
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)

2
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();

Loading…
Cancel
Save