From 6406dc69f0d46296f0e37245f56f83991b42c4bf Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 17 Oct 2024 13:03:39 +1300 Subject: [PATCH] ENH Update code to reflect changes to silverstripe/admin --- src/CampaignAdmin.php | 8 ++++---- src/CampaignAdminList.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CampaignAdmin.php b/src/CampaignAdmin.php index d182916f..5c16c965 100644 --- a/src/CampaignAdmin.php +++ b/src/CampaignAdmin.php @@ -144,7 +144,7 @@ public function getClientConfig() 'url' => $this->Link('removeCampaignItem/:id/:itemId'), 'method' => 'post' ], - 'treeClass' => $this->config()->get('tree_class') + 'treeClass' => $this->getModelClass() ]); } @@ -235,7 +235,7 @@ protected function getListResource() $items = $this->getListItems(); $count = $items->count(); /** @var string $treeClass */ - $treeClass = $this->config()->get('tree_class'); + $treeClass = $this->getModelClass(); $hal = [ 'count' => $count, 'total' => $count, @@ -813,11 +813,11 @@ public function providePermissions() return array( "CMS_ACCESS_CampaignAdmin" => array( 'name' => _t( - 'SilverStripe\\CMS\\Controllers\\CMSMain.ACCESS', + LeftAndMain::class . '.ACCESS', "Access to '{title}' section", array('title' => static::menu_title()) ), - 'category' => _t('SilverStripe\\Security\\Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), + 'category' => _t(LeftAndMain::class . '.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t( __CLASS__.'.ACCESS_HELP', 'Allow viewing of the campaign publishing section.' diff --git a/src/CampaignAdminList.php b/src/CampaignAdminList.php index 3bc780ab..9f1b4bf3 100644 --- a/src/CampaignAdminList.php +++ b/src/CampaignAdminList.php @@ -32,7 +32,7 @@ public function getSchemaDataDefaults() // Get endpoints from admin $admin = CampaignAdmin::singleton(); - $data['data']['recordType'] = $admin->config()->uninherited('tree_class'); + $data['data']['recordType'] = $admin->getModelClass(); $oneSetAction = $admin->Link("set") . "/:id"; $setsAction = $admin->Link("sets"); $schemaEndpoint = $admin->Link("schema") . "/DetailEditForm";