Skip to content

Commit

Permalink
API Deprecate API being removed in CMS 6 (#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Feb 26, 2025
1 parent a9b1073 commit 856274f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Controllers/ElementSiteTreeFilterSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Convert;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Forms\DateField;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataList;

/**
* @deprecated 5.4.0 Will be removed without equivalent functionality
*/
class ElementSiteTreeFilterSearch extends CMSSiteTreeFilter_Search
{
use Configurable;
Expand All @@ -30,6 +34,12 @@ class ElementSiteTreeFilterSearch extends CMSSiteTreeFilter_Search
*/
private $extraTermFilters = [];

public function __construct($params = null)
{
Deprecation::noticeWithNoReplacment('5.4.0', scope: Deprecation::SCOPE_CLASS);
parent::__construct($params);
}

/**
* We can't use ORM filtering for PHP methods, so we'll perform our own PHP "search" and get a list of
* matching SiteTree record IDs, then add that to the original ORM query.
Expand Down
8 changes: 8 additions & 0 deletions src/Extensions/ElementalCMSMainExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\Core\Extension;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Forms\DropdownField;
use SilverStripe\Forms\Form;

/**
* @extends Extension<CMSMain>
* @deprecated 5.4.0 Will be removed without equivalent functionality
*/
class ElementalCMSMainExtension extends Extension
{
public function __construct()
{
Deprecation::noticeWithNoReplacment('5.4.0', scope: Deprecation::SCOPE_CLASS);
parent::__construct();
}

/**
* Remove the empty default string on the class filter, which adds "All pages" again. This is already
* added by ElementSiteTreeFilterSearch.
Expand Down
3 changes: 3 additions & 0 deletions src/Extensions/ElementalPageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use DNADesign\Elemental\Models\ElementalArea;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\Controller;
use SilverStripe\Dev\Deprecation;
use SilverStripe\View\Parsers\HTMLValue;
use SilverStripe\View\SSViewer;

Expand Down Expand Up @@ -80,9 +81,11 @@ public function getElementsForSearch()

/**
* Returns the contents of all Elements on the pages ElementalAreas for use in CMS search
* @deprecated 5.4.0 Will be removed without equivalent functionality
*/
public function getContentFromElementsForCmsSearch(): string
{
Deprecation::noticeWithNoReplacment('5.4.0');
$output = [];
$elements = $this->getEagerLoadedElements();
/** @var BaseElement $element */
Expand Down
3 changes: 3 additions & 0 deletions src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class BaseElement extends DataObject implements CMSPreviewable
/**
* List of fields to exclude from CMS SiteTree seatch
* @see ElementSiteTreeFilterSearch::applyDefaultFilters()
* @deprecated 5.4.0 Will be removed without equivalent functionality
*/
private static array $fields_excluded_from_cms_search = [
'ExtraClass',
Expand Down Expand Up @@ -544,9 +545,11 @@ public function getContentForSearchIndex(): string

/**
* Provides content for CMS search if ElementSiteTreeFilterSearch.render_elements is false
* @deprecated 5.4.0 Will be removed without equivalent functionality
*/
public function getContentForCmsSearch(): string
{
Deprecation::noticeWithNoReplacment('5.4.0');
$fieldNames = $this->getTextualDatabaseFieldNames();
$excludedFieldNames = $this->getFieldNamesExcludedFromCmsSearch();
$contents = [];
Expand Down

0 comments on commit 856274f

Please sign in to comment.