Merge pull request #170 from MikePenhall/master

Update FieldEditor.php with Postgres compatible SQL syntax
This commit is contained in:
Will Rossiter 2013-11-03 19:40:28 -08:00
commit 831983e0a8

View File

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