From 1989e1a9497826040b42f467f5370f54b2cea569 Mon Sep 17 00:00:00 2001 From: ralf Date: Wed, 14 Sep 2022 14:44:45 +0200 Subject: [PATCH] fix PHP 8.1 makes all schema errors fatal, change that back to previous behavior, to ease updates --- api/src/Db/Schema.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api/src/Db/Schema.php b/api/src/Db/Schema.php index ff730a7f77..356ebbdb90 100644 --- a/api/src/Db/Schema.php +++ b/api/src/Db/Schema.php @@ -948,7 +948,12 @@ class Schema } else { - $retval = $this->dict->ExecuteSQLArray($aSql); + try { + $retval = $this->dict->ExecuteSQLArray($aSql); + } + catch (\mysqli_sql_exception $e) { + $retval = 1; + } } if ($retval < 2 || $this->debug >= $debug_level || $this->debug > 3) { @@ -1532,4 +1537,4 @@ class Schema $this->$kind = $tabledef[$kind]; } } -} +} \ No newline at end of file