mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
FIX External redirects shouldnt show in preview pane
This commit is contained in:
parent
cfcbfea88e
commit
a530085016
@ -227,13 +227,22 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
|
|
||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function LinkPreview() {
|
public function LinkPreview() {
|
||||||
$record = $this->getRecord($this->currentPageID());
|
$record = $this->getRecord($this->currentPageID());
|
||||||
$baseLink = ($record && $record instanceof Page) ? $record->Link('?stage=Stage') : Director::absoluteBaseURL();
|
$baseLink = Director::absoluteBaseURL();
|
||||||
|
if ($record && $record instanceof Page) {
|
||||||
|
// if we are an external redirector don't show a link
|
||||||
|
if ($record instanceof RedirectorPage && $record->RedirectionType == 'External') {
|
||||||
|
$baseLink = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$baseLink = $record->Link('?stage=Stage');
|
||||||
|
}
|
||||||
|
}
|
||||||
return $baseLink;
|
return $baseLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user