BUGFIX: Don't recreate a missing draft page when calling SiteTree::doUnpublish()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101170 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-03-17 00:30:09 +00:00
parent 4b191bdaba
commit 52538032a8

View File

@ -2067,7 +2067,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// If we're on the draft site, then we can update the status.
// Otherwise, these lines will resurrect an inappropriate record
if(Versioned::current_stage() != 'Live') {
if(DB::query("SELECT \"ID\" FROM \"SiteTree\" WHERE \"ID\" = $this->ID")->value()
&& Versioned::current_stage() != 'Live') {
$this->Status = "Unpublished";
$this->write();
}