Update FieldEditor.php

This commit is contained in:
Mike Penhall 2013-11-04 16:08:32 +13:00
parent 06ad657f6c
commit a6400dcfd0

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;