diff --git a/src/Element/WebformElementEncrypt.php b/src/Element/WebformElementEncrypt.php index 45644d6..8d76e81 100644 --- a/src/Element/WebformElementEncrypt.php +++ b/src/Element/WebformElementEncrypt.php @@ -85,6 +85,10 @@ class WebformElementEncrypt extends FormElement { $values = $form_state->getValues(); + // To avoid generating an unnecessary dependency on webform_encrypt when no + // webform components have encryption enabled: + // 1. Only save our settings if any of the fields are set to be encrypted. + // 2. Remove our settings if none of the fields are set to be encrypted. $field_name = $values['key']; if (empty($values['encrypt'])) { unset($config['settings'][$field_name]);