Skip to content
Snippets Groups Projects
Commit 0874c17d authored by keshav's avatar keshav Committed by Shashank Kumar
Browse files

Issue #3379015: Remove unnecessary configuration form fields while saving form.

parent 8d316907
No related branches found
No related tags found
1 merge request!29Issue #3379015: Remove unnecessary configuration form fields while saving form.
......@@ -57,9 +57,18 @@ class TwilioAdminForm extends ConfigFormBase {
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this->config('twilio.settings');
// Skip unnecessary fields.
$skip_fields = [
'form_build_id',
'form_token',
'form_id',
'twilio_callback_container',
'actions',
];
foreach (Element::children($form) as $variable) {
$config->set($variable, $form_state->getValue($form[$variable]['#parents']));
if (!in_array($variable, $skip_fields) ) {
$config->set($variable, $form_state->getValue($form[$variable]['#parents']));
}
}
$config->save();
......
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