From 409a8322a843ec90981d618964f9bfdb951ce6a3 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 8 Mar 2021 18:50:50 +0000 Subject: [PATCH 1/2] Issue 9996: "bd" is a date field it cannot be empty --- src/Model/Contact.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index cacc3e4f1..e68ae4769 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2579,9 +2579,7 @@ class Contact public static function updateBirthdays() { $condition = [ - '`bd` != "" - AND `bd` > "0001-01-01" - AND SUBSTRING(`bd`, 1, 4) != `bdyear` + '`bd` > "0001-01-01" AND (`contact`.`rel` = ? OR `contact`.`rel` = ?) AND NOT `contact`.`pending` AND NOT `contact`.`hidden` From e826a4dafd1b265596dd6137220845be566708d7 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 8 Mar 2021 18:57:19 +0000 Subject: [PATCH 2/2] We now use a constant --- src/Model/Contact.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index e68ae4769..8b28575ed 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2579,13 +2579,14 @@ class Contact public static function updateBirthdays() { $condition = [ - '`bd` > "0001-01-01" + '`bd` > ? AND (`contact`.`rel` = ? OR `contact`.`rel` = ?) AND NOT `contact`.`pending` AND NOT `contact`.`hidden` AND NOT `contact`.`blocked` AND NOT `contact`.`archive` AND NOT `contact`.`deleted`', + DBA::NULL_DATE, self::SHARING, self::FRIEND ];