Merge pull request #169 from MikePenhall/master

Escaped addField() query to work with Postgres
This commit is contained in:
Will Rossiter 2013-11-01 00:07:24 -07:00
commit 151def76dc

View File

@ -188,9 +188,9 @@ class FieldEditor extends FormField {
$sqlQuery = new SQLQuery();
$sqlQuery = $sqlQuery
->setSelect('MAX(Sort)')
->setFrom("EditableFormField")
->setWhere("ParentID = $parentID");
->setSelect("MAX(\"Sort\")")
->setFrom("\"EditableFormField\"")
->setWhere("\"ParentID\" = $parentID");
$sort = $sqlQuery->execute()->value() + 1;