mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Another fix for array_values() throwing a warning when using Tree Behavior under certain
situations.
This commit is contained in:
parent
4b269e3170
commit
2c1e6de7d6
1 changed files with 7 additions and 2 deletions
|
@ -163,10 +163,15 @@ class TreeBehavior extends ModelBehavior {
|
|||
$Model->data[$Model->alias][$parent] = null;
|
||||
$this->_addToWhitelist($Model, $parent);
|
||||
} else {
|
||||
list($node) = array_values($Model->find('first', array(
|
||||
$values = $Model->find('first', array(
|
||||
'conditions' => array($scope,$Model->escapeField() => $Model->id),
|
||||
'fields' => array($Model->primaryKey, $parent, $left, $right ), 'recursive' => $recursive)
|
||||
));
|
||||
);
|
||||
|
||||
if ($values === false) {
|
||||
return false;
|
||||
}
|
||||
list($node) = array_values($values);
|
||||
|
||||
$parentNode = $Model->find('first', array(
|
||||
'conditions' => array($scope, $Model->escapeField() => $Model->data[$Model->alias][$parent]),
|
||||
|
|
Loading…
Reference in a new issue