Skip to content

Commit

Permalink
Merge pull request #492 from creative-commoners/pulls/2/depr-messages
Browse files Browse the repository at this point in the history
API Update deprecations
  • Loading branch information
GuySartorelli authored Nov 20, 2022
2 parents 1e311e8 + aba286d commit ceaa915
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/Extensions/SiteTreeSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace SilverStripe\Subsites\Extensions;

use SilverStripe\Dev\Deprecation;
use Page;
use SilverStripe\CMS\Forms\SiteTreeURLSegmentField;
use SilverStripe\CMS\Model\SiteTree;
Expand Down Expand Up @@ -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');

Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Model/Subsite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit ceaa915

Please sign in to comment.