Skip to content
Snippets Groups Projects
Commit 1b17092e authored by Dieter Holvoet's avatar Dieter Holvoet
Browse files

Issue #3432131 by DieterHolvoet: Submitted values are overwritten by default values from CiviCRM

parent f7e55a22
No related branches found
No related tags found
1 merge request!18Don't set a default value if the field already has a value
......@@ -120,6 +120,10 @@ class WebformSubmissionHandler {
if (!empty($values) && empty($values['is_error'])) {
unset($values['is_error']);
foreach ($values as $field => $value) {
$existingValue = $webform_submission->getElementData($field);
if ($existingValue !== NULL && $existingValue !== '') {
continue;
}
$this->setDefaultValue($form, $form_state, $webform_submission, $field, $value);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment