MINOR Removed unnecessary SiteTree->Status setting in ContentController, ErrorPage and SiteTree - now controlled via getters like isPublished() (copied from efe710e2d30c6cff8599a76de2b24f315b53a088)

This commit is contained in:
Ingo Schommer 2011-03-25 16:48:37 +13:00
parent 0bcb57dfb5
commit 3380bc6457
3 changed files with 0 additions and 8 deletions

View File

@ -433,7 +433,6 @@ HTML;
// The manifest should be built by now, so it's safe to publish the 404 page
$fourohfour = Versioned::get_one_by_stage('ErrorPage', 'Stage', '"ErrorCode" = 404');
if($fourohfour) {
$fourohfour->Status = "Published";
$fourohfour->write();
$fourohfour->publish("Stage", "Live");
}

View File

@ -77,7 +77,6 @@ class ErrorPage extends Page {
$pageNotFoundErrorPage->ErrorCode = 404;
$pageNotFoundErrorPage->Title = _t('ErrorPage.DEFAULTERRORPAGETITLE', 'Page not found');
$pageNotFoundErrorPage->Content = _t('ErrorPage.DEFAULTERRORPAGECONTENT', '<p>Sorry, it seems you were trying to access a page that doesn\'t exist.</p><p>Please check the spelling of the URL you were trying to access and try again.</p>');
$pageNotFoundErrorPage->Status = 'New page';
$pageNotFoundErrorPage->write();
$pageNotFoundErrorPage->publish('Stage', 'Live');
}
@ -105,7 +104,6 @@ class ErrorPage extends Page {
$serverErrorPage->ErrorCode = 500;
$serverErrorPage->Title = _t('ErrorPage.DEFAULTSERVERERRORPAGETITLE', 'Server error');
$serverErrorPage->Content = _t('ErrorPage.DEFAULTSERVERERRORPAGECONTENT', '<p>Sorry, there was a problem with handling your request.</p>');
$serverErrorPage->Status = 'New page';
$serverErrorPage->write();
$serverErrorPage->publish('Stage', 'Live');
}

View File

@ -1297,7 +1297,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$homepage->Title = _t('SiteTree.DEFAULTHOMETITLE', 'Home');
$homepage->Content = _t('SiteTree.DEFAULTHOMECONTENT', '<p>Welcome to SilverStripe! This is the default homepage. You can edit this page by opening <a href="admin/">the CMS</a>. You can now access the <a href="http://doc.silverstripe.org">developer documentation</a>, or begin <a href="http://doc.silverstripe.org/doku.php?id=tutorials">the tutorials.</a></p>');
$homepage->URLSegment = 'home';
$homepage->Status = 'Published';
$homepage->Sort = 1;
$homepage->write();
$homepage->publish('Stage', 'Live');
@ -1309,7 +1308,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$aboutus = new Page();
$aboutus->Title = _t('SiteTree.DEFAULTABOUTTITLE', 'About Us');
$aboutus->Content = _t('SiteTree.DEFAULTABOUTCONTENT', '<p>You can fill this page out with your own content, or delete it and create your own pages.<br /></p>');
$aboutus->Status = 'Published';
$aboutus->Sort = 2;
$aboutus->write();
$aboutus->publish('Stage', 'Live');
@ -1319,7 +1317,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$contactus = new Page();
$contactus->Title = _t('SiteTree.DEFAULTCONTACTTITLE', 'Contact Us');
$contactus->Content = _t('SiteTree.DEFAULTCONTACTCONTENT', '<p>You can fill this page out with your own content, or delete it and create your own pages.<br /></p>');
$contactus->Status = 'Published';
$contactus->Sort = 3;
$contactus->write();
$contactus->publish('Stage', 'Live');
@ -2029,7 +2026,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// Handle activities undertaken by decorators
$this->invokeWithExtensions('onBeforePublish', $original);
$this->Status = "Published";
//$this->PublishedByID = Member::currentUser()->ID;
$this->write();
$this->publish("Stage", "Live");
@ -2120,7 +2116,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// Otherwise, these lines will resurrect an inappropriate record
if(DB::query("SELECT \"ID\" FROM \"SiteTree\" WHERE \"ID\" = $this->ID")->value()
&& Versioned::current_stage() != 'Live') {
$this->Status = "Unpublished";
$this->write();
}