mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
ENH Don't use deprecated method (#3006)
This commit is contained in:
parent
24bb95d3bf
commit
4b3e1f09bf
@ -29,6 +29,6 @@ class CMSBatchAction_Archive extends CMSBatchAction
|
||||
public function applicablePages($ids)
|
||||
{
|
||||
// canArchive() is deprecated, not $this->applicablePagesHelper()
|
||||
return Deprecation::withNoReplacement(fn() => $this->applicablePagesHelper($ids, 'canArchive'));
|
||||
return Deprecation::withSuppressedNotice(fn() => $this->applicablePagesHelper($ids, 'canArchive'));
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class CMSBatchAction_Restore extends CMSBatchAction
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
Deprecation::withNoReplacement(function () {
|
||||
Deprecation::withSuppressedNotice(function () {
|
||||
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS);
|
||||
});
|
||||
}
|
||||
|
@ -1998,7 +1998,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
if (!$record || !$record->exists()) {
|
||||
throw new HTTPResponse_Exception("Bad record ID #$id", 404);
|
||||
}
|
||||
$canArchive = Deprecation::withNoReplacement(fn() => $record->canArchive());
|
||||
$canArchive = Deprecation::withSuppressedNotice(fn() => $record->canArchive());
|
||||
if (!$canArchive) {
|
||||
return Security::permissionFailure();
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ class LinkablePlugin implements ModelQueryPlugin
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
Deprecation::withNoReplacement(function () {
|
||||
Deprecation::withSuppressedNotice(function () {
|
||||
Deprecation::notice('5.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
|
||||
});
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ class Resolver
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
Deprecation::withNoReplacement(function () {
|
||||
Deprecation::withSuppressedNotice(function () {
|
||||
Deprecation::notice('5.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
|
||||
});
|
||||
}
|
||||
|
@ -2578,7 +2578,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
||||
|
||||
// If a page is on any stage it can be archived
|
||||
if (($isOnDraft || $isPublished)) {
|
||||
$canArchive = Deprecation::withNoReplacement(fn() => $this->canArchive());
|
||||
$canArchive = Deprecation::withSuppressedNotice(fn() => $this->canArchive());
|
||||
if ($canArchive) {
|
||||
$title = $isPublished
|
||||
? _t('SilverStripe\\CMS\\Controllers\\CMSMain.UNPUBLISH_AND_ARCHIVE', 'Unpublish and archive')
|
||||
|
@ -18,10 +18,10 @@ abstract class SiteTreeExtension extends DataExtension
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// Wrapping with Deprecation::withNoReplacement() to avoid triggering deprecation notices
|
||||
// Wrapping with Deprecation::withSuppressedNotice() to avoid triggering deprecation notices
|
||||
// as we are unable to update existing subclasses of this class until a new major
|
||||
// unless we add in the pointless empty methods that are in this class
|
||||
Deprecation::withNoReplacement(function () {
|
||||
Deprecation::withSuppressedNotice(function () {
|
||||
$class = Extension::class;
|
||||
Deprecation::notice('5.3.0', "Subclass $class instead", Deprecation::SCOPE_CLASS);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user