Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Update code to reflect changes in silverstripe/admin #337

Draft
wants to merge 1 commit into
base: 3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/CampaignAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
]);
}

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/CampaignAdminList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down