Skip to main content
add note
Source Link
Bisonbleu
  • 422
  • 2
  • 9

The reason why the value of the field does not change (assuming the name of your module == webform_presave) 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';
  }
}

See hook_webform_submission_presave() in webform.api.php.

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';
  }
}

The reason why the value of the field does not change (assuming the name of your module == webform_presave) 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';
  }
}

See hook_webform_submission_presave() in webform.api.php.

Source Link
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';
  }
}