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 method signature to match parent class #3015

Merged
Merged
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
10 changes: 0 additions & 10 deletions _config.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<?php

use SilverStripe\Admin\CMSMenu;
use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\CMS\Controllers\CMSPageAddController;
use SilverStripe\CMS\Controllers\CMSPageEditController;
use SilverStripe\CMS\Controllers\CMSPageSettingsController;
Comment on lines -3 to -7
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these are used anymore

use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
Expand All @@ -31,8 +26,3 @@
'sitetree_link',
[SiteTree::class, 'link_shortcode_handler']
);

CMSMenu::remove_menu_class(CMSMain::class);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that CMSMain itself is a special case and should not get ignore_menuitem set to true.

CMSMenu::remove_menu_class(CMSPageEditController::class);
CMSMenu::remove_menu_class(CMSPageSettingsController::class);
CMSMenu::remove_menu_class(CMSPageAddController::class);
2 changes: 2 additions & 0 deletions code/Controllers/CMSPageAddController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class CMSPageAddController extends CMSPageEditController
private static $menu_title = 'Add page';
private static $required_permission_codes = 'CMS_ACCESS_CMSMain';

private static $ignore_menuitem = true;

private static $allowed_actions = [
'AddForm',
'doAdd',
Expand Down
4 changes: 3 additions & 1 deletion code/Controllers/CMSPageEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ class CMSPageEditController extends CMSMain

private static $required_permission_codes = 'CMS_ACCESS_CMSMain';

private static $ignore_menuitem = true;

private static $allowed_actions = [
'AddToCampaignForm',
];

public function getClientConfig()
public function getClientConfig(): array
{
return ArrayLib::array_merge_recursive(parent::getClientConfig(), [
'form' => [
Expand Down
2 changes: 2 additions & 0 deletions code/Controllers/CMSPageSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class CMSPageSettingsController extends CMSMain

private static $required_permission_codes = 'CMS_ACCESS_CMSMain';

private static $ignore_menuitem = true;

public function getEditForm($id = null, $fields = null)
{
$record = $this->getRecord($id ?: $this->currentPageID());
Expand Down
Loading