mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Removed unnecessary SiteTree->Status setting in ContentController, ErrorPage and SiteTree - now controlled via getters like isPublished()
This commit is contained in:
parent
c9c794a75b
commit
efe710e2d3
@ -431,7 +431,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");
|
||||
}
|
||||
|
@ -74,7 +74,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');
|
||||
}
|
||||
@ -102,7 +101,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');
|
||||
}
|
||||
|
@ -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');
|
||||
@ -2028,7 +2025,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");
|
||||
@ -2119,7 +2115,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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user