Skip to content

Commit

Permalink
fixes #5971 - Error generated by behavior if invoking overloaded meth…
Browse files Browse the repository at this point in the history
…od from within the behavior

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7993 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
AD7six committed Jan 14, 2009
1 parent 67b9a80 commit eec4d15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cake/libs/model/behaviors/tree.php
Expand Up @@ -618,19 +618,19 @@ function recover(&$model, $mode = 'parent', $missingParentAction = null) {
function reorder(&$model, $options = array()) {
$options = array_merge(array('id' => null, 'field' => $model->displayField, 'order' => 'ASC', 'verify' => true), $options);
extract($options);
if ($verify && !$model->verify()) {
if ($verify && !$this->verify($model)) {
return false;
}
$verify = false;
extract($this->settings[$model->alias]);
$fields = array($model->primaryKey, $field, $left, $right);
$sort = $field . ' ' . $order;
$nodes = $model->children($id, true, $fields, $sort, null, null, $recursive);
$nodes = $this->children($model, $id, true, $fields, $sort, null, null, $recursive);

if ($nodes) {
foreach ($nodes as $node) {
$id = $node[$model->alias][$model->primaryKey];
$model->moveDown($id, true);
$this->moveDown($model, $id, true);
if ($node[$model->alias][$left] != $node[$model->alias][$right] - 1) {
$this->reorder($model, compact('id', 'field', 'order', 'verify'));
}
Expand Down

0 comments on commit eec4d15

Please sign in to comment.