BUG Adding context parameter to canCreate-check in getClassDropdown of SiteTree (fixes #1334)

This commit is contained in:
Stephan Bauer 2016-01-02 23:06:06 +01:00
parent d387d4f311
commit b30d33585f

View File

@ -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 ($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')) {