Skip to content

Commit

Permalink
Adding specific conditions to model->delete's call to dbo->delete. This
Browse files Browse the repository at this point in the history
helps fix a race condition where dbo->defaultConditions could cause
additional data loss.  Fixes #250
  • Loading branch information
markstory committed Nov 9, 2010
1 parent bc7770a commit e8678b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/model/model.php
Expand Up @@ -1831,7 +1831,7 @@ function delete($id = null, $cascade = true) {
));
}

if ($db->delete($this)) {
if ($db->delete($this, array($this->alias . '.' . $this->primaryKey => $id))) {
if (!empty($this->belongsTo)) {
$this->updateCounterCache($keys[$this->alias]);
}
Expand Down

0 comments on commit e8678b3

Please sign in to comment.