From aaaf9cdfcd75d8c014c5cae9aaa1310f124539ec Mon Sep 17 00:00:00 2001 From: Geoff Munn Date: Wed, 11 Mar 2009 23:03:28 +0000 Subject: [PATCH] API CHANGE: queries fixed for MSSQL git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72929 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Hierarchy.php | 2 +- security/Member.php | 2 +- security/Security.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/model/Hierarchy.php b/core/model/Hierarchy.php index 375cc8dc2..33e440790 100644 --- a/core/model/Hierarchy.php +++ b/core/model/Hierarchy.php @@ -497,7 +497,7 @@ class Hierarchy extends DataObjectDecorator { * @return DataObjectSet */ public function stageChildren($showAll = false) { - $extraFilter = $showAll ? '' : " AND \"ShowInMenus\""; + $extraFilter = $showAll ? '' : " AND \"ShowInMenus\"=1"; $baseClass = ClassInfo::baseDataClass($this->owner->class); $staged = DataObject::get($baseClass, "\"{$baseClass}\".\"ParentID\" = " . (int)$this->owner->ID . " AND \"{$baseClass}\".\"ID\" != " . (int)$this->owner->ID . $extraFilter, ""); diff --git a/security/Member.php b/security/Member.php index eddcb2059..b6e988711 100644 --- a/security/Member.php +++ b/security/Member.php @@ -654,7 +654,7 @@ class Member extends DataObject { if(count($collatedGroups) > 0) { $collatedGroups = implode(", ", array_unique($collatedGroups)); - $unfilteredGroups = singleton('Group')->instance_get("\"ID\" IN ($collatedGroups)", '"ID"', "", "", "Member_GroupSet"); + $unfilteredGroups = singleton('Group')->instance_get("\"ID\" IN ($collatedGroups)", "\"Group\".\"ID\"", "", "", "Member_GroupSet"); $result = new ComponentSet(); // Only include groups where allowedIPAddress() returns true diff --git a/security/Security.php b/security/Security.php index 7d9fb2fc6..a4d0b54df 100644 --- a/security/Security.php +++ b/security/Security.php @@ -583,7 +583,7 @@ class Security extends Controller { * privileges. */ static function findAnAdministrator($username = 'admin', $password = 'password') { - $permission = DataObject::get_one("Permission", "\"Code\" = 'ADMIN'", true, '"ID"'); + $permission = DataObject::get_one("Permission", "\"Code\" = 'ADMIN'", true, "\"Permission\".\"ID\""); $adminGroup = null; if($permission) $adminGroup = DataObject::get_one("Group", "\"Group\".\"ID\" = '{$permission->GroupID}'", true, "\"Group\".\"ID\"");