From c3102267e6150260893bef86956dd1a03caa5c88 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Mon, 9 Dec 2024 12:47:51 +1300 Subject: [PATCH] ENH Update code to avoid using deprecated API --- src/Forms/GridFieldSiteTreeAddNewButton.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;