Skip to content

Commit

Permalink
BUGFIX: getItem didn't consider the PostgreSQL SQL syntax. Columns wi…
Browse files Browse the repository at this point in the history
…th 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
  • Loading branch information
Rainer Spittel authored and Sam Minnee committed Feb 2, 2011
1 parent 0226781 commit 2d7b75d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/model/SQLMap.php
Expand Up @@ -38,7 +38,7 @@ public function __construct(SQLQuery $query, $keyField = "ID", $titleField = "Ti
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'];
Expand Down

0 comments on commit 2d7b75d

Please sign in to comment.