summaryrefslogtreecommitdiff
path: root/modules/field/field.crud.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-03-30 05:24:38 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-03-30 05:24:38 +0000
commit243ecdaf523d7f93d0c82f2c5eba8f9412291d94 (patch)
treea3f10ed4b8aa65c0d1319b20619b86e3053a2794 /modules/field/field.crud.inc
parent9f7aaa2341b914d455949ac5d1044256f25a5856 (diff)
downloadbrdo-243ecdaf523d7f93d0c82f2c5eba8f9412291d94.tar.gz
brdo-243ecdaf523d7f93d0c82f2c5eba8f9412291d94.tar.bz2
#394246 by flobruit: Check to ensure that field type is specified.
Diffstat (limited to 'modules/field/field.crud.inc')
-rw-r--r--modules/field/field.crud.inc4
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.');