From 2d7b75d4cbd3265d048e7ccdcf44407b07240136 Mon Sep 17 00:00:00 2001 From: Rainer Spittel Date: Tue, 17 Aug 2010 20:44:23 +0000 Subject: [PATCH] BUGFIX: getItem didn't consider the PostgreSQL SQL syntax. Columns with Capital letters must be quoted. Added quotes to the where clause in getItem. I didn't added quotes to the baseTable because it causes PostgreSQL errors (tables can not be double quoted, just single quoted). git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@109591 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SQLMap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/model/SQLMap.php b/core/model/SQLMap.php index b2568f47f..933591ef3 100755 --- a/core/model/SQLMap.php +++ b/core/model/SQLMap.php @@ -38,7 +38,7 @@ class SQLMap extends Object implements IteratorAggregate { public function getItem($id) { if($id) { $baseTable = reset($this->query->from); - $this->query->where[] = "$baseTable.ID = $id"; + $this->query->where[] = "$baseTable.\"ID\" = $id"; $record = $this->query->execute()->first(); if($record) { $className = $record['ClassName'];