From 4e72a2b60ff6ea2a57fc0a368532fcc1960ced5c Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Thu, 28 Apr 2022 14:36:26 +0200 Subject: [PATCH] fix: event edition for caldav driver Set to NULL for real in db values that equals NULL in PHP. Only tested on PostgreSQL --- drivers/caldav/caldav_driver.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/caldav/caldav_driver.php b/drivers/caldav/caldav_driver.php index 6ebf666..c934a4a 100644 --- a/drivers/caldav/caldav_driver.php +++ b/drivers/caldav/caldav_driver.php @@ -945,6 +945,8 @@ class caldav_driver extends calendar_driver $sql_set[] = $this->rc->db->quote_identifier($col) . '=' . $this->rc->db->quote($event[$col]->format(self::DB_DATE_FORMAT)); else if (is_array($event[$col])) $sql_set[] = $this->rc->db->quote_identifier($col) . '=' . $this->rc->db->quote(join(',', $event[$col])); + else if (array_key_exists($col, $event) && is_null($event[$col])) + $sql_set[] = $this->rc->db->quote_identifier($col) . '=NULL'; else if (array_key_exists($col, $event)) { //TODO: proper 4 byte character (eg emoticons) handling //utf8 in mysql only supports 3 byte characters, so this throws an error if there are emoticons in the description.