diff --git a/includes/webform.components.inc b/includes/webform.components.inc index a2c5738..c45f2bd 100644 --- a/includes/webform.components.inc +++ b/includes/webform.components.inc @@ -1019,6 +1019,9 @@ function webform_component_parent_keys($node, $component) { * Populate a component with the defaults for that type. */ function webform_component_defaults(&$component) { + if (empty($component['extra']['attributes']['title'])) { + $component['extra']['attributes']['title'] = check_plain($component['name']); + } if ($defaults = webform_component_invoke($component['type'], 'defaults')) { foreach ($defaults as $key => $default) { if (!isset($component[$key])) { diff --git a/webform.module b/webform.module index 5ec7400..c5c1802 100644 --- a/webform.module +++ b/webform.module @@ -3003,6 +3003,12 @@ function theme_webform_element($variables) { } $output = '
' . "\n"; + // If #title_display is none, set it to invisible instead - none only used if + // we have no title at all to use. + if ($element['#title_display'] == 'none') { + $variables['element']['#title_display'] = 'invisible'; + $element['#title_display'] = 'invisible'; + } // If #title is not set, we don't display any label or required marker. if (!isset($element['#title'])) { $element['#title_display'] = 'none';