mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-12 20:49:50 +00:00
fixes #5971 - Error generated by behavior if invoking overloaded method from within the behavior
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7993 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
67b9a80bcf
commit
eec4d15898
1 changed files with 3 additions and 3 deletions
|
@ -618,19 +618,19 @@ class TreeBehavior extends ModelBehavior {
|
|||
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'));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue