Skip to content

Commit

Permalink
Read the $Model->primaryKey instead of 'id'. Avoids problems with rec…
Browse files Browse the repository at this point in the history
…ently created registry.
  • Loading branch information
rafaelfelix committed Mar 23, 2012
1 parent 3b990a8 commit 58f407e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/behaviors/revision.php
Expand Up @@ -808,7 +808,7 @@ public function afterSave(&$Model, $created) {
}
if ($created) {
$Model->ShadowModel->create($Model->data,true);
$Model->ShadowModel->set('id',$Model->id);
$Model->ShadowModel->set($Model->primaryKey,$Model->id);
$Model->ShadowModel->set('version_created',date('Y-m-d H:i:s'));
foreach ($Model->data as $alias => $alias_data) {
if (isset($Model->ShadowModel->_schema[$alias])) {
Expand Down

0 comments on commit 58f407e

Please sign in to comment.