You are here

function hook_webform_submission_presave in Webform 7.3

Same name and namespace in other branches
  1. 6.3 webform.api.php \hook_webform_submission_presave()
  2. 7.4 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

1 function implements hook_webform_submission_presave()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

webform_webform_submission_presave in ./webform.module
Implements hook_webform_submission_update().
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 116
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';
}