Make RSS feed work with objects that don't support AbsoluteLink, such as the forum

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2@50914 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-03-11 23:49:44 +00:00
parent 9d902aa8cd
commit 3fa6d91992

View File

@ -280,7 +280,9 @@ class RSSFeed_Entry extends ViewableData {
* @return string Returns the URL of this entry
*/
function AbsoluteLink() {
return $this->failover->AbsoluteLink();
if($this->failover->hasMethod('AbsoluteLink')) return $this->failover->AbsoluteLink();
else if($this->failover->hasMethod('Link')) return Director::absoluteURL($this->link);
else user_error($this->failover->class . " object has either an AbsoluteLink nor a Link method. Can't put a link in the RSS feed", E_USER_WARNING);
}
}
?>