mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fixed SiteTree::doRestoreToStage() for db abstraction.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76369 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
29afa282b9
commit
f296534380
@ -1516,7 +1516,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
// if no record can be found on draft stage (meaning it has been "deleted from draft" before),
|
||||
// create an empty record
|
||||
if(!DB::query("SELECT ID FROM SiteTree WHERE ID = $this->ID")->value()) {
|
||||
DB::query("INSERT INTO SiteTree SET ID = $this->ID");
|
||||
$conn = DB::getConn();
|
||||
if($conn->hasMethod('allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing('SiteTree', true);
|
||||
DB::query("INSERT INTO \"SiteTree\" (\"ID\") VALUES ($this->ID)");
|
||||
if($conn->hasMethod('allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing('SiteTree', false);
|
||||
}
|
||||
|
||||
$oldStage = Versioned::current_stage();
|
||||
|
Loading…
Reference in New Issue
Block a user