Skip to content
Snippets Groups Projects

Update SettingsForm.php

Open Aman Naudiyal requested to merge issue/entity_sort-3424532:1.x into 1.x
1 file
+ 5
2
Compare changes
  • Side-by-side
  • Inline
+ 5
2
@@ -144,9 +144,12 @@ class SettingsForm extends ConfigFormBase {
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$weightSettings = $form_state->getValue('weight_settings');
$config = $this->config('entity_sort.settings');
$config->set('weight_fields', array_filter($form_state->getValue('weight_settings')));
$config->save();
if (is_array($weightSettings)) {
$config->set('weight_fields', array_filter($form_state->getValue('weight_settings')));
$config->save();
}
}
/**
Loading