Fixed event filter creation with empty name

This commit is contained in:
Luis Calvo 2020-12-23 15:33:52 +01:00
parent bc74565662
commit f6a1260eef
1 changed files with 8 additions and 4 deletions

View File

@ -205,12 +205,16 @@ if ($update) {
}
if ($create) {
$id = db_process_sql_insert('tevent_filter', $values);
if (!empty($values['id_name'])) {
$id = db_process_sql_insert('tevent_filter', $values);
if ($id === false) {
ui_print_error_message('Error creating filter');
if ($id === false) {
ui_print_error_message('Error creating filter');
} else {
ui_print_success_message('Filter created successfully');
}
} else {
ui_print_success_message('Filter created successfully');
ui_print_error_message('Filter name must not be empty');
}
}