Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Removed unnecessary SiteTree->Status setting in ContentControll…

…er, ErrorPage and SiteTree - now controlled via getters like isPublished() (copied from efe710e)
  • Loading branch information...
commit 3380bc64571fcb1a4907068c434888467de4ba83 1 parent 0bcb57d
@chillu chillu authored
View
1  code/ContentController.php
@@ -433,7 +433,6 @@ function successfullyinstalled() {
// 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
2  code/ErrorPage.php
@@ -77,7 +77,6 @@ function requireDefaultRecords() {
$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 @@ function requireDefaultRecords() {
$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
5 code/SiteTree.php
@@ -1297,7 +1297,6 @@ function requireDefaultRecords() {
$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 @@ function requireDefaultRecords() {
$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 @@ function requireDefaultRecords() {
$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 @@ function doPublish() {
// 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 @@ function doUnpublish() {
// 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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.