diff options
Diffstat (limited to 'modules/field/field.crud.inc')
-rw-r--r-- | modules/field/field.crud.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc index b96dbfb4b..6993250e6 100644 --- a/modules/field/field.crud.inc +++ b/modules/field/field.crud.inc @@ -178,6 +178,10 @@ function field_create_field($field) { if (empty($field['field_name'])) { throw new FieldException('Attempt to create an unnamed field.'); } + // Field type is required. + if (empty($field['type'])) { + throw new FieldException('Attempt to create a field with no type.'); + } // Field name cannot contain invalid characters. if (preg_match('/[^a-z0-9_]/', $field['field_name'])) { throw new FieldException('Attempt to create a field with invalid characters. Only alphanumeric characters and underscores are allowed.'); |