From ee5b0e2447a220974b40b83b8a44745618a4877c Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Sat, 18 Oct 2008 22:31:04 +0000 Subject: [PATCH] MINOR ErrorPage removal of ShowInMenus explicitly being set - this is done using static $defaults on the class itself. MINOR ErrorPage phpDoc updates - removal of non-existant token @usedby, replaced with @see MINOR Code formatting changes to be more consistent git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64502 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/ErrorPage.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/core/model/ErrorPage.php b/core/model/ErrorPage.php index ce35c7519..014ec4f5d 100755 --- a/core/model/ErrorPage.php +++ b/core/model/ErrorPage.php @@ -7,8 +7,9 @@ * This enables us to show errors even if PHP experiences a recoverable error. * ErrorPages * + * @see Debug::friendlyError() + * * @package cms - * @usedby Debug::friendlyError() */ class ErrorPage extends Page { @@ -22,24 +23,24 @@ class ErrorPage extends Page { ); /** - * Ensures that there is always a 404 page. + * Ensures that there is always a 404 page + * by checking if there's an instance of + * ErrorPage with a 404 error code. If there + * is not, one is created when the DB is built. */ function requireDefaultRecords() { parent::requireDefaultRecords(); - if(!DataObject::get_one("ErrorPage", "ErrorCode = '404'")) { + if(!DataObject::get_one('ErrorPage', "ErrorCode = '404'")) { $errorpage = new ErrorPage(); $errorpage->ErrorCode = 404; $errorpage->Title = _t('ErrorPage.DEFAULTERRORPAGETITLE', 'Page not found'); - $errorpage->URLSegment = "page-not-found"; - $errorpage->ShowInMenus = false; + $errorpage->URLSegment = 'page-not-found'; $errorpage->Content = _t('ErrorPage.DEFAULTERRORPAGECONTENT', '

Sorry, it seems you were trying to access a page that doesn\'t exist.

Please check the spelling of the URL you were trying to access and try again.

'); - $errorpage->Status = "New page"; + $errorpage->Status = 'New page'; $errorpage->write(); - // Don't publish, as the manifest may not be built yet - // $errorpage->publish("Stage", "Live"); - Database::alteration_message("404 page created","created"); + Database::alteration_message('404 page created', 'created'); } }