From cf355d1d5cee7fe815821b15f9f1632f8b7d83f4 Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 5 Sep 2022 10:52:01 +0200 Subject: [PATCH] do NOT stall because DB does not know the TZ, report once per session Happens with PHP 8.1 and older MariaDB (or MySQL) without (loaded) timezone data Unknown or incorrect time zone: 'UTC' --- api/src/Db.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/api/src/Db.php b/api/src/Db.php index f4ab80c667..ffbc5b5313 100644 --- a/api/src/Db.php +++ b/api/src/Db.php @@ -1218,7 +1218,18 @@ class Db } if (!empty($timezone) && !empty($sql)) { - $this->Link_ID->Execute($sql); + try { + $this->Link_ID->Execute($sql); + } + catch (\Exception $e) { + // do NOT stall because DB does not know the TZ, report once per session + if (empty($_SESSION[Session::EGW_APPSESSION_VAR][__CLASS__]['SQL-error-TZ'])) + { + _egw_log_exception($e); + $_SESSION[Session::EGW_APPSESSION_VAR][__CLASS__]['SQL-error-TZ'] = 'reported'; + } + return false; + } return true; } }