mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
6f79d66e3a
commit
f18a9d3cc6
@ -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'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user