From aba286d8a3638caaed7392ac73859e8d8923929e Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 16 Nov 2022 11:55:02 +1300 Subject: [PATCH] API Update deprecations --- src/Extensions/SiteTreeSubsites.php | 7 +++++-- src/Model/Subsite.php | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Extensions/SiteTreeSubsites.php b/src/Extensions/SiteTreeSubsites.php index 58ca33d6..324ce730 100644 --- a/src/Extensions/SiteTreeSubsites.php +++ b/src/Extensions/SiteTreeSubsites.php @@ -2,6 +2,7 @@ namespace SilverStripe\Subsites\Extensions; +use SilverStripe\Dev\Deprecation; use Page; use SilverStripe\CMS\Forms\SiteTreeURLSegmentField; use SilverStripe\CMS\Model\SiteTree; @@ -266,11 +267,12 @@ public function duplicateToSubsite($subsiteID = null, $includeChildren = false) * It may be that some relations are not diostinct to sub site so can stay * whereas others may need to be duplicated * - * @deprecated 2.2..3.0 Use the "cascade_duplicates" config API instead + * @deprecated 2.2.0 Use the "cascade_duplicates" config API instead * @param SiteTree $originalPage */ public function duplicateSubsiteRelations($originalPage) { + Deprecation::notice('2.2.0', 'Use the "cascade_duplicates" config API instead'); $thisClass = $originalPage->ClassName; $relations = Config::inst()->get($thisClass, 'duplicate_to_subsite_relations'); @@ -444,13 +446,14 @@ public function updatePreviewLink(&$link, $action = null) * This function is marked as deprecated for removal in 5.0.0 in silverstripe/cms * so now simply passes execution to where the functionality exists for backwards compatiblity. * CMS 4.0.0 SiteTree already throws a SilverStripe deprecation error before calling this function. - * @deprecated 2.2...3.0 use updatePreviewLink instead + * @deprecated 2.2.0 Use updatePreviewLink() instead * * @param string|null $action * @return string */ public function alternatePreviewLink($action = null) { + Deprecation::notice('2.2.0', 'Use updatePreviewLink() instead'); $link = ''; return $this->updatePreviewLink($link, $action); } diff --git a/src/Model/Subsite.php b/src/Model/Subsite.php index d78f60e3..fb819fc2 100644 --- a/src/Model/Subsite.php +++ b/src/Model/Subsite.php @@ -56,7 +56,7 @@ class Subsite extends DataObject * Allows you to force a specific subsite ID, or comma separated list of IDs. * Only works for reading. An object cannot be written to more than 1 subsite. * - * @deprecated 2.0.0..3.0.0 Use SubsiteState::singleton()->withState() instead. + * @deprecated 2.0.0 Use SubsiteState::singleton()->withState() instead. */ public static $force_subsite = null; @@ -201,11 +201,11 @@ public static function currentSubsite() * * @return int ID of the current subsite instance * - * @deprecated 2.0..3.0 Use SubsiteState::singleton()->getSubsiteId() instead + * @deprecated 2.0.0 Use SubsiteState::singleton()->getSubsiteId() instead */ public static function currentSubsiteID() { - Deprecation::notice('3.0', 'Use SubsiteState::singleton()->getSubsiteId() instead'); + Deprecation::notice('2.0.0', 'Use SubsiteState::singleton()->getSubsiteId() instead'); return SubsiteState::singleton()->getSubsiteId(); }