Hello,
I'm theming the webform-submission.tpl page and I wasn't able to use $submission. Yet it's write on the 10th line :

* - $submission: The Webform submission array.

Then I remember that in webform.report.inc we access to a submission with the array $submissions, and indeed the name of the variable is $submissions.

I noticed that this typing mistake is present in other template files, I thank you in advance to correct this small error.

Comments

quicksketch’s picture

Category: Task » Bug report
Issue summary: View changes
Status: Active » Closed (cannot reproduce)

Then I remember that in webform.report.inc we access to a submission with the array $submissions, and indeed the name of the variable is $submissions.

The variable in the webform-submission.tpl.php file is just $submission; it's not plural. As far as I can tell, the variable name and documentation are already both correct.

For the webform-submission.tpl.php file, you can see the variable being set here:

/**
 * Preprocess function for webform-submission.tpl.php.
 */
function template_preprocess_webform_submission(&$vars) {
  $vars['node'] = $vars['renderable']['#node'];
  $vars['submission'] = $vars['renderable']['#submission'];
  $vars['email'] = $vars['renderable']['#email'];
  $vars['format'] = $vars['renderable']['#format'];
}

If there's another template that has the incorrect documentation, please let me know.