I'm receiving this pile of messages every time I'm saving a web form with Name Field that contains all default settings.

Notice: Undefined index: #field_prefix in theme_webform_display_textfield() (line 193 of C:\wamp\www\sites\all\modules\webform\components\textfield.inc).
    Notice: Undefined index: #field_suffix in theme_webform_display_textfield() (line 194 of C:\wamp\www\sites\all\modules\webform\components\textfield.inc).
    Notice: Undefined index: #field_prefix in theme_webform_display_textfield() (line 193 of C:\wamp\www\sites\all\modules\webform\components\textfield.inc).
    Notice: Undefined index: #field_suffix in theme_webform_display_textfield() (line 194 of C:\wamp\www\sites\all\modules\webform\components\textfield.inc).
    Notice: Undefined index: #field_prefix in theme_webform_display_textfield() (line 193 of C:\wamp\www\sites\all\modules\webform\components\textfield.inc).
    Notice: Undefined index: #field_suffix in theme_webform_display_textfield() (line 194 of C:\wamp\www\sites\all\modules\webform\components\textfield.inc).
    Notice: Undefined index: #field_prefix in theme_webform_display_textfield() (line 193 of C:\wamp\www\sites\all\modules\webform\components\textfield.inc).
    Notice: Undefined index: #field_suffix in theme_webform_display_textfield() (line 194 of C:\wamp\www\sites\all\modules\webform\components\textfield.inc).

Comments

sashkernel’s picture

Version: 7.x-1.5 » 7.x-1.6

Same thing in 7.x-16

Alan D.’s picture

I haven't seen these errors myself, but you could try this in "name/includes/webform.components.inc". The two bottom lines that start with the + sign (but do not include the "+" in the file)

function _webform_display_name($name, $value, $format = 'html') {
  $themed_name = theme('name_item', array(
    'item' => $value,
    'format' => $name['extra']['display_format'],
  ));

  return array(
    '#title' => $name['name'],
    '#weight' => $name['weight'],
    '#theme' => 'webform_display_textfield',
    '#theme_wrappers' => $format == 'html' ? array('webform_element') : array('webform_element_text'),
    '#post_render' => array('webform_element_wrapper'),
    '#component' => $name,
    '#format' => $format,
    '#value' => $themed_name,
+    '#field_prefix' => '',
+    '#field_suffix' => '',
  );
}
sashkernel’s picture

Thank you Alan,
That does the trick.

Alan D.’s picture

Status: Active » Fixed

Excellent, I retagged a new release so that users don't need to use the dev version for the next 4 or 5 months (I have no further plans to do anything for a while)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.