From 87e17be08484bfaa1fd74a28bd6232ee9243c5ee Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 15 Jan 2024 12:38:42 +0100 Subject: [PATCH] #12156 fix error on update when empty db values --- pandora_console/include/functions_notifications.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandora_console/include/functions_notifications.php b/pandora_console/include/functions_notifications.php index 78b5facde4..89027fbf81 100644 --- a/pandora_console/include/functions_notifications.php +++ b/pandora_console/include/functions_notifications.php @@ -677,6 +677,12 @@ function notifications_set_user_label_status($source, $user, $label, $value) } $eixsts = db_get_row('tnotification_source_user', 'id_user', $user); + if (empty($eixsts['enabled']) && empty($eixsts['also_mail'])) { + $sql = sprintf('DELETE FROM tnotification_source_user WHERE id_user = "%s" AND id_source = "%s"', $user, $source); + db_process_sql($sql); + $eixsts = false; + } + if ($eixsts === false) { db_process_sql_insert( 'tnotification_source_user',