diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 71f434c18..3265b4d19 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1892,6 +1892,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid // Call delete on a cloned object so that this one doesn't lose its ID $this->flushCache(); $clone = DataObject::get_by_id("SiteTree", $this->ID); + if (!$clone) $clone = Versioned::get_one_by_stage('SiteTree', 'Live', '"SiteTree_Live"."ID" = ' . $this->ID); $clone->deleteFromStage('Live'); $this->Status = "Unpublished";