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). (from r109591)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112827 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-19 01:25:32 +00:00
parent 458f3b1197
commit ac33763d05

View File

@ -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'];