BUGFIX: Detect a brokenh link on an incompletely specified redirector page. (from r89043)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89215 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-10-15 22:41:14 +00:00
parent 07aefc8138
commit 675e841c6e

View File

@ -94,7 +94,12 @@ class RedirectorPage extends Page {
function syncLinkTracking() {
if ($this->RedirectionType == 'Internal') {
$this->HasBrokenLink = DataObject::get_by_id('SiteTree', $this->LinkToID) ? false : true;
if($this->LinkToID) {
$this->HasBrokenLink = DataObject::get_by_id('SiteTree', $this->LinkToID) ? false : true;
} else {
// An incomplete redirector page definitely has a broken link
$this->HasBrokenLink = true;
}
} else {
// TODO implement checking of a remote site
$this->HasBrokenLink = false;