From 2c10d1526fa2feddbbd40f73a9cb894091a5d8a7 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 16 Sep 2010 20:14:49 +0000 Subject: - Patch #740834 by makononov, sun: form elements cannot be rendered without form_builder(). --- modules/field_ui/field_ui.admin.inc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'modules/field_ui') diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc index cf3e8c3e9..dcfd7eca4 100644 --- a/modules/field_ui/field_ui.admin.inc +++ b/modules/field_ui/field_ui.admin.inc @@ -1648,13 +1648,22 @@ function field_ui_field_edit_form($form, &$form_state, $instance) { $bundles = field_info_bundles(); // Create a form structure for the instance values. - $form['instance'] = array( + // @todo Fieldset element info needs to be merged in order to not skip the + // default element definition for #pre_render. While the current default + // value could simply be hard-coded, we'd possibly forget this location + // when system_element_info() is updated. See also form_builder(). This + // particular #pre_render, field_ui_field_edit_instance_pre_render(), might + // as well be entirely needless though. + $form['instance'] = array_merge(element_info('fieldset'), array( '#tree' => TRUE, '#type' => 'fieldset', '#title' => t('%type settings', array('%type' => $bundles[$entity_type][$bundle]['label'])), - '#description' => t('These settings apply only to the %field field when used in the %type type.', array('%field' => $instance['label'], '%type' => $bundles[$entity_type][$bundle]['label'])), + '#description' => t('These settings apply only to the %field field when used in the %type type.', array( + '%field' => $instance['label'], + '%type' => $bundles[$entity_type][$bundle]['label'], + )), '#pre_render' => array('field_ui_field_edit_instance_pre_render'), - ); + )); // Build the non-configurable instance values. $form['instance']['field_name'] = array( -- cgit v1.2.3