From b30d33585f4640950dc573b9fa283c0db7b5f14c Mon Sep 17 00:00:00 2001 From: Stephan Bauer Date: Sat, 2 Jan 2016 23:06:06 +0100 Subject: [PATCH] BUG Adding context parameter to canCreate-check in getClassDropdown of SiteTree (fixes #1334) --- code/model/SiteTree.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 429e9542..baf184e2 100755 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -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')) {