#12156 fix error on update when empty db values

This commit is contained in:
Jonathan 2024-01-15 12:38:42 +01:00
parent 43b8db9c84
commit 87e17be084
1 changed files with 6 additions and 0 deletions

View File

@ -677,6 +677,12 @@ function notifications_set_user_label_status($source, $user, $label, $value)
} }
$eixsts = db_get_row('tnotification_source_user', 'id_user', $user); $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) { if ($eixsts === false) {
db_process_sql_insert( db_process_sql_insert(
'tnotification_source_user', 'tnotification_source_user',