diff --git a/src/Forms/GridFieldSiteTreeAddNewButton.php b/src/Forms/GridFieldSiteTreeAddNewButton.php index dd869ae..26c9d10 100644 --- a/src/Forms/GridFieldSiteTreeAddNewButton.php +++ b/src/Forms/GridFieldSiteTreeAddNewButton.php @@ -66,7 +66,7 @@ public function getHTMLFragments($gridField) { $state = $gridField->State->GridFieldSiteTreeAddNewButton; - $parent = SiteTree::get()->byId(Controller::curr()->currentPageID()); + $parent = SiteTree::get()->byId(Controller::curr()->currentRecordID()); if ($parent) { $state->currentPageID = $parent->ID;