Skip to content

Commit

Permalink
API Deprecate API that will be removed (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Sep 13, 2024
1 parent d132e64 commit 2713c3a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Tasks/SubsiteCopyPagesTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -77,16 +78,22 @@ 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()));
});
}
}

unset($children);
}
}

/**
* @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";
}
}

0 comments on commit 2713c3a

Please sign in to comment.