- Issue created by @hartsak
First of all, thanks for the nice module!
It seems to do what it's supposed to do, but I noticed a small bug/unexpected feature when installing the module and saving the settings form (and exporting configs).
After installation and after saving module settings form unnecessary items will be added to the module configuration file "user_prune.settings.yml"
Those items are described here:
message: Hello
(This seems to come from user_prune/config/install/user_prune.settings.yml)
submit:
form_build_id:
form_token:
form_id:
op:
This happens most likely because how the settings are saved in "user_prune/src/Form/UserPruneSettingsForm.php"
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this->config('user_prune.settings');
foreach ($form_state->getValues() as $key => $value) {
$config->set($key, $value);
}
$config->save();
$this->messenger()->addStatus($this->t("Configuration saved!"));
}
I believe $form_state->getValues() contains more than just the intended form input fields and thus unnecessary form element values gets added to the module configuration file.
Active
1.5
Code