Merge branch '2.1' into 2.2

This commit is contained in:
Ceeram 2012-06-19 18:35:36 +02:00
commit 03e2263b69
7 changed files with 35 additions and 23 deletions

View file

@ -2370,13 +2370,14 @@ class Model extends Object implements CakeEventListener {
break;
}
}
$keys = $this->find('first', array(
'fields' => $this->_collectForeignKeys(),
'conditions' => array($this->alias . '.' . $this->primaryKey => $id),
'recursive' => -1,
'callbacks' => false
));
if ($updateCounterCache) {
$keys = $this->find('first', array(
'fields' => $this->_collectForeignKeys(),
'conditions' => array($this->alias . '.' . $this->primaryKey => $id),
'recursive' => -1,
'callbacks' => false
));
}
}
if ($db->delete($this, array($this->alias . '.' . $this->primaryKey => $id))) {