From afb06e4a80a6fed0436bd921fe7ce0b46d22a735 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 16 Dec 2009 05:39:09 +0000 Subject: [PATCH] MINOR #4973 Automatically generate URLSegment for default records on SiteTree and ErrorPage instead of explicitly setting them (from r94352) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@95599 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/ErrorPage.php | 1 - core/model/SiteTree.php | 2 -- 2 files changed, 3 deletions(-) diff --git a/core/model/ErrorPage.php b/core/model/ErrorPage.php index dc4617d19..11f8ead3e 100755 --- a/core/model/ErrorPage.php +++ b/core/model/ErrorPage.php @@ -63,7 +63,6 @@ class ErrorPage extends Page { $errorpage = new ErrorPage(); $errorpage->ErrorCode = 404; $errorpage->Title = _t('ErrorPage.DEFAULTERRORPAGETITLE', 'Page not found'); - $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->write(); diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index c4306641d..f31ffffe1 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1215,7 +1215,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $aboutus = new Page(); $aboutus->Title = _t('SiteTree.DEFAULTABOUTTITLE', 'About Us'); $aboutus->Content = _t('SiteTree.DEFAULTABOUTCONTENT', '

You can fill this page out with your own content, or delete it and create your own pages.

'); - $aboutus->URLSegment = "about-us"; $aboutus->write(); $aboutus->publish("Stage", "Live"); DB::alteration_message("About Us created","created"); @@ -1223,7 +1222,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $contactus = new Page(); $contactus->Title = _t('SiteTree.DEFAULTCONTACTTITLE', 'Contact Us'); $contactus->Content = _t('SiteTree.DEFAULTCONTACTCONTENT', '

You can fill this page out with your own content, or delete it and create your own pages.

'); - $contactus->URLSegment = "contact-us"; $contactus->write(); $contactus->publish("Stage", "Live");