Escaped addField() query to work with Postgres

I was getting a warning in the CMS with a Postgres database due to the fields on lines 191 - 193 not being double quoted.
This commit is contained in:
Mike Penhall 2013-11-01 16:08:15 +13:00
parent aa0f8dbc7b
commit 06ad657f6c

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;