Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 22938d95e942fad53306957ef53c1ff6e7003773 1 parent f5714a8
@markstory markstory authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  cake/libs/model/model.php
View
2  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]);
}
Please sign in to comment.
Something went wrong with that request. Please try again.