mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
Merge pull request #1353 from sb-relaxt-at/1334-sitetree-classdropdown-bugfix
Adding context parameter to canCreate-check in getClassDropdown
This commit is contained in:
commit
b54d2f1f7f
@ -2639,7 +2639,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
|
|
||||||
// if the current page type is this the same as the class type always show the page type in the list
|
// if the current page type is this the same as the class type always show the page type in the list
|
||||||
if ($this->ClassName != $instance->ClassName) {
|
if ($this->ClassName != $instance->ClassName) {
|
||||||
if((($instance instanceof HiddenClass) || !$instance->canCreate())) continue;
|
if($instance instanceof HiddenClass) continue;
|
||||||
|
if(!$instance->canCreate(null, array('Parent' => $this->ParentID ? $this->Parent() : null))) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($perms = $instance->stat('need_permission')) {
|
if($perms = $instance->stat('need_permission')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user