"cannot use a scalar value as an array" warning for adding #prefix and #suffix in template.php via hook-form-alter – Drupal 7
Warning: Cannot use a scalar value as an array in MYTHEME_form_alter()


It is a common PHP error which means you are treating a scalar value (eg: int, string) as an array.

You can fix it by checking if it is an array before using it.

function MYTHEME_form_alter(&amp;$form, &amp;$form_state, $form_id) {

  if ($form_id == 'webform_client_form_MYFORMID') {
    foreach($form['submitted'] as &amp;$field) {
      if (is_array($field)) {
        $field['#prefix'] = '&lt;li&gt;';
        $field['#suffix'] = '&lt;/li&gt;';
      }
    }
  }


As mentioned by @Clive

Since you are adding #prefix and #suffix, you are obviously trying to change for the render element. So it would be better to limit the change occurred on render element only.

element_children is the API provided by Drupal for that purpose.

function MYTHEME_form_alter(&amp;$form, &amp;$form_state, $form_id) {

  if ($form_id == 'webform_client_form_MYFORMID') {
    foreach($element_children($form['submitted']) as $key) {
      $field = &amp;$form['submitted'][$key];
      $field['#prefix'] = '&lt;li&gt;';
      $field['#suffix'] = '&lt;/li&gt;';
    }
  }