Skip to content
This repository
Browse code

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 e8678b38acc898f0756fdf8875d6661c3020b87f 1 parent bc7770a
Mark Story authored November 08, 2010

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  cake/libs/model/model.php
2  cake/libs/model/model.php
@@ -1831,7 +1831,7 @@ function delete($id = null, $cascade = true) {
1831 1831
 				));
1832 1832
 			}
1833 1833
 
1834  
-			if ($db->delete($this)) {
  1834
+			if ($db->delete($this, array($this->alias . '.' . $this->primaryKey => $id))) {
1835 1835
 				if (!empty($this->belongsTo)) {
1836 1836
 					$this->updateCounterCache($keys[$this->alias]);
1837 1837
 				}

0 notes on commit e8678b3

Please sign in to comment.
Something went wrong with that request. Please try again.