From df91c536de2a4964aa42b977cb5280fb464655f9 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 8 Jun 2009 04:53:42 +0000 Subject: [PATCH] BUGFIX If a field wasn't selected to add, show an nicer error instead of a php error --- code/editor/FieldEditor.php | 1 + 1 file changed, 1 insertion(+) diff --git a/code/editor/FieldEditor.php b/code/editor/FieldEditor.php index bddbfa6..154585b 100755 --- a/code/editor/FieldEditor.php +++ b/code/editor/FieldEditor.php @@ -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();