Permalink
Browse files

Adding specific conditions to model->delete's call to dbo->delete. This

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 22938d95e942fad53306957ef53c1ff6e7003773
Showing with 1 addition and 1 deletion.
  1. +1 −1 cake/libs/model/model.php
@@ -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]);
}

0 comments on commit 22938d9

Please sign in to comment.