From 2713c3a113e49b6e9c067ad60c8e7af9a4b47e34 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:18:24 +1200 Subject: [PATCH] API Deprecate API that will be removed (#599) --- src/Tasks/SubsiteCopyPagesTask.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Tasks/SubsiteCopyPagesTask.php b/src/Tasks/SubsiteCopyPagesTask.php index 375806ac..d434f399 100644 --- a/src/Tasks/SubsiteCopyPagesTask.php +++ b/src/Tasks/SubsiteCopyPagesTask.php @@ -5,6 +5,7 @@ use InvalidArgumentException; use SilverStripe\CMS\Model\SiteTree; use SilverStripe\Dev\BuildTask; +use SilverStripe\Dev\Deprecation; use SilverStripe\ORM\DataObject; use SilverStripe\Subsites\Model\Subsite; use SilverStripe\Subsites\Pages\SubsitesVirtualPage; @@ -77,7 +78,9 @@ public function run($request) $childClone->copyVersionToStage('Stage', 'Live'); array_push($stack, [$child->ID, $childClone->ID]); - $this->log(sprintf('Copied "%s" (#%d, %s)', $child->Title, $child->ID, $child->Link())); + Deprecation::withNoReplacement(function () use ($child) { + $this->log(sprintf('Copied "%s" (#%d, %s)', $child->Title, $child->ID, $child->Link())); + }); } } @@ -85,8 +88,12 @@ public function run($request) } } + /** + * @deprecated 3.4.0 Will be replaced with new $output parameter in the run() method + */ public function log($msg) { + Deprecation::notice('3.4.0', 'Will be replaced with new $output parameter in the run() method'); echo $msg . "\n"; } }