Skip to content

Commit

Permalink
Merge branch '6.0' into 6
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 27, 2025
2 parents 01cace3 + fc8b992 commit bf6908c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
12 changes: 12 additions & 0 deletions code/Controllers/CMSMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Core\Manifest\ModuleResource;
use SilverStripe\Core\Manifest\ModuleResourceLoader;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Forms\DateField;
use SilverStripe\Forms\DropdownField;
use SilverStripe\Forms\FieldGroup;
Expand Down Expand Up @@ -896,9 +897,16 @@ public function ExtraTreeTools(): string

/**
* Returns the search form schema for the current model
*
* @return string
* @deprecated 5.4.0 Will be replaced with SilverStripe\ORM\Search\SearchContextForm::getSchemaData()
*/
public function getSearchFieldSchema(): string
{
Deprecation::noticeWithNoReplacment(
'5.4.0',
'Will be replaced with SilverStripe\ORM\Search\SearchContextForm::getSchemaData()'
);
$schemaUrl = $this->Link('schema/SearchForm');

$singleton = DataObject::singleton($this->getModelClass());
Expand Down Expand Up @@ -1664,9 +1672,11 @@ public function childfilter(HTTPRequest $request): HTTPResponse
* @param array $params Query parameters to use, or null if none present
* @return CMSSiteTreeFilter The filter class
* @throws InvalidArgumentException if invalid filter class is passed.
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected function getQueryFilter($params)
{
Deprecation::noticeWithNoReplacment('5.4.0');
if (empty($params['FilterClass'])) {
return null;
}
Expand All @@ -1686,9 +1696,11 @@ protected function getQueryFilter($params)
* @param int $parentID Optional parent node to filter on (can't be combined with other search criteria)
* @return SS_List
* @throws InvalidArgumentException if invalid filter class is passed.
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
public function getList($params = [], $parentID = 0)
{
Deprecation::noticeWithNoReplacment('5.4.0');
if ($filter = $this->getQueryFilter($params)) {
return $filter->getFilteredPages();
} else {
Expand Down
23 changes: 23 additions & 0 deletions code/Controllers/CMSSiteTreeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use SilverStripe\Core\ClassInfo;
use SilverStripe\Core\Convert;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Forms\DateField;
use SilverStripe\ORM\DataList;
use SilverStripe\Model\List\SS_List;
Expand All @@ -32,13 +33,15 @@ abstract class CMSSiteTreeFilter implements LeftAndMain_SearchFilter
* Caution: Unescaped data.
*
* @var array
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $params = [];

/**
* List of filtered items and all their parents
*
* @var array
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $_cache_ids = null;

Expand All @@ -49,21 +52,25 @@ abstract class CMSSiteTreeFilter implements LeftAndMain_SearchFilter
* others in the complete set.
*
* @var array
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $_cache_highlight_ids = null;

/**
* @var array
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $_cache_expanded = [];

/**
* @var string
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $childrenMethod = null;

/**
* @var string
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $numChildrenMethod = 'numChildren';

Expand Down Expand Up @@ -103,13 +110,21 @@ public function __construct($params = null)
}
}

/**
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
public function getChildrenMethod()
{
Deprecation::noticeWithNoReplacment('5.4.0');
return $this->childrenMethod;
}

/**
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
public function getNumChildrenMethod()
{
Deprecation::noticeWithNoReplacment('5.4.0');
return $this->numChildrenMethod;
}

Expand Down Expand Up @@ -137,18 +152,22 @@ abstract public function getFilteredPages();

/**
* @return array Map of Page IDs to their respective ParentID values.
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it
*/
public function pagesIncluded()
{
Deprecation::noticeWithNoReplacment('5.4.0');
return $this->mapIDs($this->getFilteredPages());
}

/**
* Populate the IDs of the pages returned by pagesIncluded(), also including
* the necessary parent helper pages.
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it
*/
protected function populateIDs()
{
Deprecation::noticeWithNoReplacment('5.4.0');
$parents = [];
$this->_cache_ids = [];
$this->_cache_highlight_ids = [];
Expand Down Expand Up @@ -192,9 +211,11 @@ public function isRecordIncluded($page)
*
* @param DataList $query Unfiltered query
* @return DataList Filtered query
* @deprecated 5.4.0 Will be replaced with a SearchContext subclass
*/
protected function applyDefaultFilters($query)
{
Deprecation::noticeWithNoReplacment('5.4.0', 'Will be replaced with a SearchContext subclass');
$sng = SiteTree::singleton();
foreach ($this->params as $name => $val) {
if (empty($val)) {
Expand Down Expand Up @@ -250,9 +271,11 @@ protected function applyDefaultFilters($query)
*
* @param SS_List $pages
* @return array
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it
*/
protected function mapIDs($pages)
{
Deprecation::noticeWithNoReplacment('5.4.0');
$ids = [];
if ($pages) {
foreach ($pages as $page) {
Expand Down
2 changes: 2 additions & 0 deletions code/Controllers/CMSSiteTreeFilter_DeletedPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ class CMSSiteTreeFilter_DeletedPages extends CMSSiteTreeFilter

/**
* @var string
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $childrenMethod = "AllHistoricalChildren";

/**
* @var string
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $numChildrenMethod = 'numHistoricalChildren';

Expand Down
2 changes: 2 additions & 0 deletions code/Controllers/CMSSiteTreeFilter_PublishedPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ public static function title()

/**
* @var string
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $childrenMethod = "AllHistoricalChildren";

/**
* @var string
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $numChildrenMethod = 'numHistoricalChildren';

Expand Down
2 changes: 2 additions & 0 deletions code/Controllers/CMSSiteTreeFilter_StatusDeletedPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ class CMSSiteTreeFilter_StatusDeletedPages extends CMSSiteTreeFilter

/**
* @var string
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $childrenMethod = "AllHistoricalChildren";

/**
* @var string
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected $numChildrenMethod = 'numHistoricalChildren';

Expand Down

0 comments on commit bf6908c

Please sign in to comment.