API CHANGE Deprecated ModelAsController->get404Page() with using the URLSegment "404" on a normal page type - please use the ErrorPage class instead

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75913 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-05-04 02:17:29 +00:00
parent 6f79d66e3a
commit f18a9d3cc6

View File

@ -122,8 +122,13 @@ class ModelAsController extends Controller implements NestedController {
}
protected function get404Page() {
if($page = DataObject::get_one("ErrorPage", "\"ErrorCode\" = '404'")) return $page;
else return DataObject::get_one("SiteTree", "\"URLSegment\" = '404'");
$page = DataObject::get_one("ErrorPage", "\"ErrorCode\" = '404'");
if($page) {
return $page;
} else {
// @deprecated 2.5 Use ErrorPage class
return DataObject::get_one("SiteTree", "\"URLSegment\" = '404'");
}
}
}