Skip to content

Commit

Permalink
Fixing condition missing a model name in the TreeBehavior. Fixes #961
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jul 31, 2010
1 parent 9f718de commit 509a9e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cake/libs/model/behaviors/tree.php
Expand Up @@ -716,7 +716,10 @@ function removefromtree(&$Model, $id = null, $delete = false) {
}

$db =& ConnectionManager::getDataSource($Model->useDbConfig);
$Model->updateAll(array($parent => $db->value($node[$parent], $parent)), array($parent => $node[$Model->primaryKey]));
$Model->updateAll(
array($parent => $db->value($node[$parent], $parent)),
array($Model->escapeField($parent) => $node[$Model->primaryKey])
);
$this->__sync($Model, 1, '-', 'BETWEEN ' . ($node[$left] + 1) . ' AND ' . ($node[$right] - 1));
$this->__sync($Model, 2, '-', '> ' . ($node[$right]));
$Model->id = $id;
Expand Down

0 comments on commit 509a9e1

Please sign in to comment.