Fixes #2982, TreeBehavior::verify, non-portable SQL, badly quoted conditions

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5806 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-10-19 21:43:48 +00:00
parent aba86fe522
commit 7ebb27fccc
3 changed files with 3 additions and 4 deletions

View file

@ -599,7 +599,7 @@ class TreeBehavior extends ModelBehavior {
$errors[] = array('node', $instance[$model->name][$model->primaryKey],
'right greater than parent (node ' . $instance['VerifyParent'][$model->primaryKey] . ').');
}
} elseif ($model->findCount(array($scope, $left => '< ' . $instance[$model->name][$left], $right => '> ' . $instance[$model->name][$right]))) {
} elseif ($model->findCount(array($scope, $left . '< ' . $instance[$model->name][$left], $right . '> ' . $instance[$model->name][$right]))) {
$errors[] = array('node', $instance[$model->name][$model->primaryKey], 'The parent field is blank, but has a parent');
}
}

View file

@ -2859,8 +2859,7 @@ class ModelTest extends CakeTestCase {
$data = array();
$expected = $this->model->save($data);
$this->assertFalse($expected);
}
}
/*function testBasicValidation() {
$this->model =& new ValidationTest();

View file

@ -43,4 +43,4 @@ class NumberTreeFixture extends CakeTestFixture {
'lft' => array ('type' => 'integer','null' => false),
'rght' => array ('type' => 'integer','null' => false));
}
?>
?>