Skip to main content
1 of 2
Bisonbleu
  • 422
  • 2
  • 9

The reason why the value of the field does not change is due to the fact that the if statement fails because $webform is not defined. Use this instead:

function webform_presave_webform_submission_presave($node, &$submission) {
  if ($node->nid == 28) {
    $component_id = 1;
    $submission->data[$component_id]['value'][0] = 'Yes';
  }
}
Bisonbleu
  • 422
  • 2
  • 9