mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1711 from dhensby/pulls/3.4/allowed-children-fix2
FIX Dont attempt to iterate over null in SiteTree::allowedChildren
This commit is contained in:
commit
f26ecb2a9c
@ -2695,8 +2695,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
// Otherwise, the class and all its subclasses are allowed.
|
||||
if(substr($candidate,0,1) == '*') {
|
||||
$allowedChildren[] = substr($candidate,1);
|
||||
} else {
|
||||
$subclasses = ClassInfo::subclassesFor($candidate);
|
||||
} elseif ($subclasses = ClassInfo::subclassesFor($candidate)) {
|
||||
foreach($subclasses as $subclass) {
|
||||
if ($subclass == 'SiteTree_root' || singleton($subclass) instanceof HiddenClass) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user