Merge branch 'ent-6893-event-filters-without-name' into 'develop'

Fixed event filter creation with empty name

See merge request artica/pandorafms!3742
This commit is contained in:
Daniel Rodriguez 2021-01-14 14:43:01 +01:00
commit 7e0a3baa1e
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');
}
}