You are here

function hook_webform_submission_presave in Webform 6.3

Same name and namespace in other branches
  1. 7.4 webform.api.php \hook_webform_submission_presave()
  2. 7.3 webform.api.php \hook_webform_submission_presave()

Modify a Webform submission, prior to saving it in the database.

Parameters

$node: The Webform node on which this submission was made.

$submission: The Webform submission that is about to be saved to the database.

Related topics

2 invocations of hook_webform_submission_presave()
webform_submission_insert in includes/webform.submissions.inc
Insert a webform submission entry in the database.
webform_submission_update in includes/webform.submissions.inc
Update a webform submission entry in the database.

File

./webform.api.php, line 115
Sample hooks demonstrating usage in Webform.

Code

function hook_webform_submission_presave($node, &$submission) {

  // Update some component's value before it is saved.
  $component_id = 4;
  $submission->data[$component_id]['value'][0] = 'foo';
}