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:
Geoff Munn 2009-09-17 00:08:21 +00:00
parent 9678b7ed48
commit 5c0b83f046

View File

@ -1758,7 +1758,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
function doRestoreToStage() {
// 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()) {
if(!DB::query("SELECT \"ID\" FROM \"SiteTree\" WHERE \"ID\" = $this->ID")->value()) {
$conn = DB::getConn();
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing('SiteTree', true);
DB::query("INSERT INTO \"SiteTree\" (\"ID\") VALUES ($this->ID)");