From e0f9137afc5026369b01dfdd50e123b343ee42d4 Mon Sep 17 00:00:00 2001 From: Geoff Munn Date: Wed, 10 Feb 2010 21:59:57 +0000 Subject: [PATCH] BUGFIX: columns quoted properly git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98694 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 21e49b305..3df76768c 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1978,17 +1978,17 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid // Unpublish all virtual pages that point here // This coupling to the subsites module is frustrating, but difficult to avoid. if(class_exists('Subsite')) { - $virtualPages = Subsite::get_from_all_subsites('VirtualPage', "CopyContentFromID = {$this->ID}"); + $virtualPages = Subsite::get_from_all_subsites('VirtualPage', "\"CopyContentFromID\" = {$this->ID}"); } else { - $virtualPages = DataObject::get('VirtualPage', "CopyContentFromID = {$this->ID}"); + $virtualPages = DataObject::get('VirtualPage', "\"CopyContentFromID\" = {$this->ID}"); } if ($virtualPages) foreach($virtualPages as $vp) $vp->doUnpublish(); $suffix = Versioned::current_stage() == 'Live' ? '_Live' : ''; if(class_exists('Subsite')) { - $redirectorPages = Subsite::get_from_all_subsites('RedirectorPage', "SiteTree$suffix.ID = SiteTree$suffix.ID AND LinkToID = {$this->ID}"); + $redirectorPages = Subsite::get_from_all_subsites('RedirectorPage', "\"SiteTree$suffix\".\"ID\" = \"SiteTree$suffix\".\"ID\" AND \"LinkToID\" = {$this->ID}"); } else { - $redirectorPages = DataObject::get('RedirectorPage', "SiteTree$suffix.ID = SiteTree$suffix.ID AND LinkToID = {$this->ID}"); + $redirectorPages = DataObject::get('RedirectorPage', "\"SiteTree$suffix\".\"ID\" = \"SiteTree$suffix\".\"ID\" AND \"LinkToID\" = {$this->ID}"); } if($redirectorPages) foreach($redirectorPages as $page) {