mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Added patch from 'shirsch' to fix Model::deleteAll() not returning a boolean value when callbacks = true. Updated test. Closes #5546
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7769 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
f32e557e9c
commit
c2fee87b63
2 changed files with 4 additions and 3 deletions
|
@ -1669,11 +1669,12 @@ class Model extends Overloadable {
|
|||
|
||||
if ($callbacks) {
|
||||
$_id = $this->id;
|
||||
|
||||
$result = true;
|
||||
foreach ($ids as $id) {
|
||||
$this->delete($id, $cascade);
|
||||
$result = ($result && $this->delete($id, $cascade));
|
||||
}
|
||||
$this->id = $_id;
|
||||
return $result;
|
||||
} else {
|
||||
foreach ($ids as $id) {
|
||||
$this->_deleteLinks($id);
|
||||
|
|
|
@ -3574,7 +3574,7 @@ class ModelTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $TestModel->deleteAll(array('Article.user_id' => array(2, 3)));
|
||||
$result = $TestModel->deleteAll(array('Article.user_id' => array(2, 3)), true, true);
|
||||
$this->assertTrue($result);
|
||||
|
||||
$TestModel->recursive = -1;
|
||||
|
|
Loading…
Reference in a new issue