mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-10 05:22:41 +00:00
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
This commit is contained in:
parent
bc7770aa83
commit
e8678b38ac
1 changed files with 1 additions and 1 deletions
|
@ -1831,7 +1831,7 @@ class Model extends Overloadable {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($db->delete($this)) {
|
if ($db->delete($this, array($this->alias . '.' . $this->primaryKey => $id))) {
|
||||||
if (!empty($this->belongsTo)) {
|
if (!empty($this->belongsTo)) {
|
||||||
$this->updateCounterCache($keys[$this->alias]);
|
$this->updateCounterCache($keys[$this->alias]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue