mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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
This commit is contained in:
parent
0226781e37
commit
2d7b75d4cb
@ -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'];
|
||||
|
Loading…
Reference in New Issue
Block a user