From 243ecdaf523d7f93d0c82f2c5eba8f9412291d94 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Mon, 30 Mar 2009 05:24:38 +0000 Subject: #394246 by flobruit: Check to ensure that field type is specified. --- modules/field/field.crud.inc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/field/field.crud.inc') 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.'); -- cgit v1.2.3