#12156 fix sql error check exists

This commit is contained in:
Jonathan 2024-01-15 13:26:28 +01:00
parent 87e17be084
commit d34bd3f223
1 changed files with 4 additions and 4 deletions

View File

@ -676,14 +676,14 @@ function notifications_set_user_label_status($source, $user, $label, $value)
return false;
}
$eixsts = db_get_row('tnotification_source_user', 'id_user', $user);
if (empty($eixsts['enabled']) && empty($eixsts['also_mail'])) {
$exists = db_process_sql(sprintf('SELECT * FROM tnotification_source_user WHERE id_user = "%s" AND id_source = "%s"', $user, $source));
if (empty($exists['enabled']) && empty($exists['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;
$exists = false;
}
if ($eixsts === false) {
if ($exists === false) {
db_process_sql_insert(
'tnotification_source_user',
[