Merge pull request #2799 from creative-commoners/pulls/4/stop-using-depr

API Stop using deprecated API
This commit is contained in:
Sabina Talipova 2022-12-05 16:34:34 +13:00 committed by GitHub
commit 495e453dce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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