It is necessary to maintain only useful data. Do not process dblogfilter.php with "empty" array\data.
In our case ($severity_levels = $config->get('severity_levels')... if (!empty($severity_levels[$level_array[$level]]))..)
(
[] == ["emergency" => 0, "alert" => 0, "critical" => 0, "error" => 0, "warning" => 0, "notice" => 0, "info" => 0, "debug" => 0]
)
dblog_filter\src\Form\DBLogFilterSettingsForm.php
public function submitForm(array &$form, FormStateInterface $form_state) {
// Save configurations.
$values = $form_state->getValues(); //dump($values);
$config = $this->config('dblog_filter.settings');
$fields = [
'severity_levels',
'log_values',
'method',
'syslog_severity_levels',
'syslog_method',
];
foreach ($fields as $field) {
if (isset($values[$field])) {
/*-*/ //$config->set($field, $values[$field]);
/*+*/ $config->set($field, is_array($values[$field]) ? array_filter($values[$field], 'is_string') : $values[$field] ); /*Store if|in array only useful values (not 0)*/
}
}
$config->save();
parent::submitForm($form, $form_state);
}
Active
3.2
Code