mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR FIX: columns quoted properly
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86511 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9678b7ed48
commit
5c0b83f046
@ -1758,7 +1758,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
function doRestoreToStage() {
|
function doRestoreToStage() {
|
||||||
// if no record can be found on draft stage (meaning it has been "deleted from draft" before),
|
// if no record can be found on draft stage (meaning it has been "deleted from draft" before),
|
||||||
// create an empty record
|
// create an empty record
|
||||||
if(!DB::query("SELECT ID FROM SiteTree WHERE ID = $this->ID")->value()) {
|
if(!DB::query("SELECT \"ID\" FROM \"SiteTree\" WHERE \"ID\" = $this->ID")->value()) {
|
||||||
$conn = DB::getConn();
|
$conn = DB::getConn();
|
||||||
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing('SiteTree', true);
|
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing('SiteTree', true);
|
||||||
DB::query("INSERT INTO \"SiteTree\" (\"ID\") VALUES ($this->ID)");
|
DB::query("INSERT INTO \"SiteTree\" (\"ID\") VALUES ($this->ID)");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user