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 Remove deprecated extension hooks #1880

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
1 change: 0 additions & 1 deletion code/LeftAndMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
use SilverStripe\Model\ArrayData;
use SilverStripe\View\Requirements;
use SilverStripe\View\SSViewer;
use SilverStripe\Dev\Deprecation;
Copy link
Member Author

Choose a reason for hiding this comment

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

Unused


/**
* LeftAndMain is the parent class of all the two-pane views in the CMS.
Expand Down
1 change: 0 additions & 1 deletion code/ModalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Forms\Form;
use SilverStripe\Dev\Deprecation;
Copy link
Member Author

Choose a reason for hiding this comment

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

Unused


/**
* Parent controller for all CMS-global modals
Expand Down
13 changes: 0 additions & 13 deletions code/ModelAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,19 +321,6 @@ protected function getGridFieldConfig(): GridFieldConfig
->addComponent($exportButton)
->addComponents(Injector::inst()->createWithArgs(GridFieldPrintButton::class, ['buttons-before-left']));

// Remove default and add our own filter header with extension points
// to retain API until deprecation in 5.0
$config->removeComponentsByType(GridFieldFilterHeader::class);
$config->addComponent(Injector::inst()->createWithArgs(GridFieldFilterHeader::class, [
false,
function ($context) {
$this->extend('updateSearchContext', $context);
},
function ($form) {
$this->extend('updateSearchForm', $form);
}
]));
Comment on lines -324 to -335
Copy link
Member Author

@GuySartorelli GuySartorelli Jan 6, 2025

Choose a reason for hiding this comment

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

We don't really have a way to deprecate these per-se, but they were removed in other admin sections already so it seems sensible to remove them from here as well.

This code was added in #665 which moved the search context from ModelAdmin into GridFieldFilterHeader - it seems clear the intention was to completely shift responsibility of managing it out of the controller and into the gridfield coponent.

Developers who need to update these can either:

  1. update the component from their own subclass of ModelAdmin
  2. update the search context in their DataObject subclass

EDIT:
These don't work anyway lol. The code for them was deprecated in CMS 4 and then subsequently removed in CMS 5.


if (!$this->showSearchForm ||
(is_array($this->showSearchForm) && !in_array($this->getModelClass(), $this->showSearchForm ?? []))
) {
Expand Down
Loading