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:
mark_story 2008-10-22 02:37:05 +00:00
parent f32e557e9c
commit c2fee87b63
2 changed files with 4 additions and 3 deletions

View file

@ -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);

View file

@ -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;