]> git.agnieray.net Git - galette.git/commitdiff
Ignore "no active transaction"
authorJohan Cwiklinski <johan@x-tnd.be>
Sat, 9 Oct 2021 08:08:28 +0000 (10:08 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Sun, 24 Oct 2021 05:30:19 +0000 (07:30 +0200)
galette/lib/Galette/Core/Install.php

index bc16b85ae3bd969c56d0d594df9c17ed637a297c..f7d85c087c02ee974fdd9770eea0883dd31be018 100644 (file)
@@ -774,7 +774,14 @@ class Install
         }
 
         if ($fatal_error) {
-            $zdb->connection->rollBack();
+            try {
+                $zdb->connection->rollBack();
+            } catch (\PDOException $e) {
+                //to avoid php8/mysql autocommit issue
+                if ($zdb->isPostgres() || (!$zdb->isPostgres() && !str_contains($e->getMessage(), 'no active transaction'))) {
+                    throw $e;
+                }
+            }
         } else {
             try {
                 $zdb->connection->commit();