BUGFIX If a field wasn't selected to add, show an nicer error instead of a php error

This commit is contained in:
Sean Harvey 2009-06-08 04:53:42 +00:00
parent f6f1085029
commit df91c536de

View File

@ -187,6 +187,7 @@ class FieldEditor extends FormField {
$sort = $highestSort->value() + 1;
$className = (isset($_REQUEST['Type'])) ? $_REQUEST['Type'] : '';
if(!$className) user_error('Please select a field type to created', E_USER_WARNING);
if(is_subclass_of($className, "EditableFormField")) {
$field = new $className();