From 837d8f83342c4b1f8e53fd12177b7b5933793c68 Mon Sep 17 00:00:00 2001 From: Jim Berry Date: Tue, 3 Jan 2012 21:13:40 +0000 Subject: [PATCH] #1393094: Remove arbitrary "field_" prefix from fields created through UI. --- modules/field_ui/field_ui.admin.inc | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc index 36c58f6..5be82e7 100644 --- a/modules/field_ui/field_ui.admin.inc +++ b/modules/field_ui/field_ui.admin.inc @@ -503,12 +503,11 @@ function field_ui_field_overview_form($f '#title' => t('New field name'), '#title_display' => 'invisible', // This field should stay LTR even for RTL languages. - '#field_prefix' => 'field_', + '#field_prefix' => '', '#field_suffix' => '‎', '#size' => 15, '#description' => t('A unique machine-readable name containing letters, numbers, and underscores.'), - // 32 characters minus the 'field_' prefix. - '#maxlength' => 26, + '#maxlength' => 32, '#prefix' => '
 
', '#machine_name' => array( 'source' => array('fields', $name, 'label'), @@ -682,14 +681,6 @@ function _field_ui_field_overview_form_validate_add_new($form, &$form_state) { if (!$field['field_name']) { form_set_error('fields][_add_new_field][field_name', t('Add new field: you need to provide a field name.')); } - // Field name validation. - else { - $field_name = $field['field_name']; - - // Add the 'field_' prefix. - $field_name = 'field_' . $field_name; - form_set_value($form['fields']['_add_new_field']['field_name'], $field_name, $form_state); - } // Missing field type. if (!$field['type']) { @@ -720,12 +711,9 @@ function _field_ui_field_overview_form_v * Whether or not the field machine name is taken. */ function _field_ui_field_name_exists($value) { - // Prefix with 'field_'. - $field_name = 'field_' . $value; - // We need to check inactive fields as well, so we can't use // field_info_fields(). - return (bool) field_read_fields(array('field_name' => $field_name), array('include_inactive' => TRUE)); + return (bool) field_read_fields(array('field_name' => $value), array('include_inactive' => TRUE)); } /** -- 1.7.4.1