From 44b0cc3070e6066b68dd4b9b2c736ee87953e1a8 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Wed, 6 Nov 2024 17:14:55 +1300 Subject: [PATCH] API Update code to reflect changes in silverstripe/admin (#337) --- src/CampaignAdmin.php | 6 +++--- src/CampaignAdminList.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CampaignAdmin.php b/src/CampaignAdmin.php index 5402113a..51465c60 100644 --- a/src/CampaignAdmin.php +++ b/src/CampaignAdmin.php @@ -61,7 +61,7 @@ class CampaignAdmin extends LeftAndMain implements PermissionProvider private static $menu_icon_class = 'font-icon-page-multiple'; - private static $tree_class = ChangeSet::class; + private static $model_class = ChangeSet::class; /** * Show published changesets @@ -144,7 +144,7 @@ public function getClientConfig(): array 'url' => $this->Link('removeCampaignItem/:id/:itemId'), 'method' => 'post' ], - 'treeClass' => $this->config()->get('tree_class') + 'treeClass' => $this->config()->get('model_class') ]); } @@ -235,7 +235,7 @@ protected function getListResource() $items = $this->getListItems(); $count = $items->count(); /** @var string $treeClass */ - $treeClass = $this->config()->get('tree_class'); + $treeClass = $this->config()->get('model_class'); $hal = [ 'count' => $count, 'total' => $count, diff --git a/src/CampaignAdminList.php b/src/CampaignAdminList.php index 3bc780ab..aeab18f0 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->config()->uninherited('model_class'); $oneSetAction = $admin->Link("set") . "/:id"; $setsAction = $admin->Link("sets"); $schemaEndpoint = $admin->Link("schema") . "/DetailEditForm";