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 f5714a8 commit 22938d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/model/model.php
Expand Up @@ -1764,7 +1764,7 @@ function del($id = null, $cascade = true) {
$keys = $this->find('first', array('fields' => $this->__collectForeignKeys()));
}

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 22938d9

Please sign in to comment.