webform.inc, line 187
$message .= theme('webform_mail_fields', '', $form_values['submitted_tree'], $node);

This part of the form_values only holds the last page.

I tried with the 1.3 version of the theme function wich prints $form_values['submitted'], it gives me a blank message (submitted values wise)

I consider this a critical bug as I believe its not intended to mail only the last page.

Working on a patch to solve it temporarily

CommentFileSizeAuthor
#2 webform.multi-page-mail-fix.patch1.56 KBrmpel

Comments

rmpel’s picture

(our) temporary solution:

use the theme function from the 1.3 version of webform

function phptemplate_webform_create_mailmessage($form_values, $node, $sid) {
  global $user, $baseurl;
  $message .=  t('Submitted on') .' '. format_date(time(), 'small') ."\n";
  $ip_address = $_SERVER['REMOTE_ADDR'];
  
  if ($user->uid) {
    $message .= t('Submitted by user') .": $user->name [$ip_address]\n";
  }
  else {
    $message .= t('Submitted by anonymous user') .": [$ip_address]\n";
  }

  $message .= "\n";

  $message .= t('Submitted values are');
  $message .= "\n\n";

  foreach ($form_values['submitted'] as $cid => $value) {
    $themed_output = theme("webform_mail_". $node->webformcomponents[$cid]['type'], $value, $node->webformcomponents[$cid]);
    if ($themed_output) {
      $themed_output = rtrim($themed_output, "\n");
      $message .= $themed_output;
      $message .= "\n";
    }
    // Generic output for single values
    elseif (!is_array($value)) {
      // Note that newlines cannot be preceeded by spaces to display properly in some clients
      if ($node->webformcomponents[$cid]['name']) {
        // if text is more than 60 characters, put it on a new line with space after
        $long = (strlen($node->webformcomponents[$cid]['name'] . $value)) > 60;
        $message .= $node->webformcomponents[$cid]['name'] .":". (empty($value) ? "\n" : ($long ? "\n$value\n\n" : " $value\n"));
      }
    }
  }
  return $message;
}
rmpel’s picture

Status: Active » Needs review
StatusFileSize
new1.56 KB

webform.inc version 1.7 patched to use $form_values['submitted'] and succeed (ofcourse :P)

Hereby added; patch for functionality

ToDo (by author preferably):
* review patch,
* comment it

quicksketch’s picture

Status: Needs review » Fixed

I'm fairly certain this issue was fixed in this past week's rounds of bug fixes. If you could try out the latest dev or wait for 1.8 and reopen if the problem still exists I'd appreciate it. Otherwise I'll assume the problem has already been fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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