Skip to content
Snippets Groups Projects
Commit 564ba3a1 authored by Klaas Eikelboom's avatar Klaas Eikelboom
Browse files

Set default for 'Update Fields' to Yes, and add the option to store the choice.

parent 62633f0f
Branches
Tags
No related merge requests found
......@@ -163,7 +163,7 @@ class FormProcessorWebformHandler extends WebformHandlerBase {
$form['additional']['fields']['update_fields'] = [
'#type' => 'select',
'#title' => 'Update fields (this might delete the fields from your form)',
'#default_value' => 0,
'#default_value' => $this->configuration['form_processor_update_fields'] ?? 1,
'#options' => ['0' => $this->t("No"), '1' => $this->t("Yes")],
];
$form['additional']['fields']['help'] = [
......@@ -283,7 +283,7 @@ class FormProcessorWebformHandler extends WebformHandlerBase {
$builder->deleteFields($values['additional']['fields']['field']);
$builder->save();
}
unset($this->configuration['update_fields']);
$this->configuration['form_processor_update_fields'] = $values['additional']['fields']['update_fields'];
}
private function getContactId() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment