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'
This commit is contained in:
ralf 2022-09-05 10:52:01 +02:00
parent 820be6cbed
commit 0961f0e7a5

View File

@ -1196,7 +1196,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;
}
}