mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-18 23:43:19 +08:00
Fixed yii\db\ActiveRecord does not updates attribute specified at optimisticLock() after save
This commit is contained in:
@@ -725,6 +725,9 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
|
||||
foreach ($values as $name => $value) {
|
||||
$changedAttributes[$name] = isset($this->_oldAttributes[$name]) ? $this->_oldAttributes[$name] : null;
|
||||
$this->_oldAttributes[$name] = $value;
|
||||
if ($name === $lock) {
|
||||
$this->$lock = $value;
|
||||
}
|
||||
}
|
||||
$this->afterSave(false, $changedAttributes);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user