BUGFIX: Fixed query syntax issues for db abstraction.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@77556 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-05-21 05:11:14 +00:00
parent 31325beec6
commit ef2c47feb8
2 changed files with 4 additions and 4 deletions

View File

@ -123,7 +123,7 @@ class CMSBatchAction_Delete extends CMSBatchAction {
if($page->canDelete()) $page->delete();
// check to see if the record exists on the live site, if it doesn't remove the tree node
$liveRecord = Versioned::get_one_by_stage( 'SiteTree', 'Live', "`SiteTree`.`ID`=$id");
$liveRecord = Versioned::get_one_by_stage( 'SiteTree', 'Live', "\"SiteTree\".\"ID\"=$id");
if($liveRecord) {
$liveRecord->IsDeletedFromStage = true;
$title = Convert::raw2js($liveRecord->TreeTitle());
@ -168,7 +168,7 @@ class CMSBatchAction_DeleteFromLive extends CMSBatchAction {
if($page->canDelete()) $page->doDeleteFromLive();
// check to see if the record exists on the live site, if it doesn't remove the tree node
$stageRecord = Versioned::get_one_by_stage( 'SiteTree', 'Stage', "`SiteTree`.`ID`=$id");
$stageRecord = Versioned::get_one_by_stage( 'SiteTree', 'Stage', "\"SiteTree\".\"ID\"=$id");
if($stageRecord) {
$stageRecord->IsAddedToStage = true;
$title = Convert::raw2js($stageRecord->TreeTitle());

View File

@ -70,8 +70,8 @@ class CMSBatchActionHandler extends RequestHandler {
if($pages) foreach($pages as $page) unset($idsFromLive[$page->ID]);
$idsFromLive = array_keys($idsFromLive);
Debug::message("`SiteTree`.ID IN (" . implode(", ", $idsFromLive) . ")");
$livePages = Versioned::get_by_stage('SiteTree', 'Live', "`SiteTree`.ID IN (" . implode(", ", $idsFromLive) . ")");
Debug::message("\"SiteTree\".\"ID\" IN (" . implode(", ", $idsFromLive) . ")");
$livePages = Versioned::get_by_stage('SiteTree', 'Live', "\"SiteTree\".\"ID\" IN (" . implode(", ", $idsFromLive) . ")");
if($pages) $pages->merge($livePages);
else $pages = $livePages;
}