BUGFIX: Fix virtual pages not returning correct content (from r98520)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102762 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-14 02:17:29 +00:00
parent 394cddb4e6
commit 9f2f88fb28

View File

@ -226,6 +226,8 @@ class VirtualPage extends Page {
$return = $this->copyContentFrom()->$funcName(); $return = $this->copyContentFrom()->$funcName();
} else if($this->copyContentFrom()->hasField($field)) { } else if($this->copyContentFrom()->hasField($field)) {
$return = $this->copyContentFrom()->getField($field); $return = $this->copyContentFrom()->getField($field);
} else if($field == 'Content') {
return '<p>' . _t('VirtualPage.NOTFOUND', 'We could not find the content for this virtual page.') . '</p>';
} }
} }
@ -261,13 +263,6 @@ class VirtualPage extends Page {
if (!$haveIt) $haveIt = $this->copyContentFrom()->hasMethod($method); if (!$haveIt) $haveIt = $this->copyContentFrom()->hasMethod($method);
return $haveIt; return $haveIt;
} }
/**
* If we ever get this far, it means that the VP failed.
*/
function Content() {
return '<p>'._t('VirtualPage.NOTFOUND', 'We could not find the content for this virtual page.').'</p>';
}
} }
/** /**