Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX Fixed quoting and GROUP BY statement in ManyManyComplexTableFi…

…eld->getQuery() for Postgres compatibility (from r111202)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112900 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit cdb04f79dea123a8e7eeb94e75a8a86122d41e51 1 parent b9ab0e6
@sminnee sminnee authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 forms/ManyManyComplexTableField.php
View
4 forms/ManyManyComplexTableField.php
@@ -73,7 +73,9 @@ function __construct($controller, $name, $sourceClass, $fieldList = null, $detai
function getQuery() {
$query = parent::getQuery();
- $query->select[] = "CASE WHEN \"{$this->manyManyParentClass}ID\" IS NULL THEN '0' ELSE '1' END AS Checked";
+ $query->select[] = "CASE WHEN \"{$this->manyManyParentClass}ID\" IS NULL THEN '0' ELSE '1' END AS \"Checked\"";
+ $query->groupby[] = "\"{$this->manyManyParentClass}ID\""; // necessary for Postgres
+
return $query;
}
Please sign in to comment.
Something went wrong with that request. Please try again.