Fix for webform themed output weirdness

  1.       foreach ($submission->data as $cid => $component_data) {
  2.         $component = $components[$webform_nid][$cid];
  3.         $label     = $components[$webform_nid][$cid]['name'];
  4.         // Hijack webform's email output theming.
  5.         // @todo: textfields do not render properly here; I am assuming that
  6.         // all single-values fields need their arrays exploding. Figure out
  7.         // what is going on with webform and do this the correct way!
  8.         if  (count($component_data['value']) == 1) {
  9.           $component_data['value'] = array_shift($component_data['value']);
  10.         }
  11.         $themed_output = theme('webform_mail_' . $component['type'], $component_data['value'], $component);

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.