mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding empty table handling in TreeBehavior::generateTreeList(), fixes #3784
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6270 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
31138695ed
commit
658b98e361
1 changed files with 3 additions and 0 deletions
|
@ -310,6 +310,9 @@ class TreeBehavior extends ModelBehavior {
|
|||
$results[$i]['tree_prefix'] = str_repeat($spacer,count($stack));
|
||||
$stack[] = $result[$model->alias][$right];
|
||||
}
|
||||
if (empty($results)) {
|
||||
return array();
|
||||
}
|
||||
return Set::combine($results, $keyPath, $valuePath);
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue