API Stop using deprecated API

This commit is contained in:
Steve Boyd 2022-11-24 13:03:26 +13:00
parent 113f4e9dfb
commit 20467b3846
1 changed files with 4 additions and 2 deletions

View File

@ -652,8 +652,10 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
public function PreviewLink($action = null)
{
if ($this->hasMethod('alternatePreviewLink')) {
Deprecation::notice('5.0', 'Use updatePreviewLink or override PreviewLink method');
return $this->alternatePreviewLink($action);
Deprecation::withNoReplacement(function () use ($action) {
Deprecation::notice('5.0', 'Use updatePreviewLink or override PreviewLink method');
return $this->alternatePreviewLink($action);
});
}
$link = $this->AbsoluteLink($action);