Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
Fix problem with afterSave not being fire for Model/Array->save if mo…
Browse files Browse the repository at this point in the history
…difying record
  • Loading branch information
romaninsh committed Apr 15, 2015
1 parent b18b218 commit afe3f43
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Controller/Data/Array.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ function save($model, $id, $data) {
->addMoreInfo('id', $data[$model->id_field]);
}
} else { // update
unset($model->_table[$this->short_name][$oldId]);
$newId = $data[$model->id_field];
//unset($model->_table[$this->short_name][$oldId]);
$newId = $id; //$data[$model->id_field];
$data = array_merge($model->_table[$this->short_name][$newId], $data);
}
$data[$model->id_field] = $newId;
$model->_table[$this->short_name][$newId] = $data;
Expand Down

0 comments on commit afe3f43

Please sign in to comment.