mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
BUGFIX If a field wasn't selected to add, show an nicer error instead of a php error
This commit is contained in:
parent
f6f1085029
commit
df91c536de
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user