]> git.agnieray.net Git - galette.git/commitdiff
Fix wrong duplicate (same exception code from a delete )
authorJohan Cwiklinski <johan@x-tnd.be>
Tue, 16 Jun 2020 21:12:33 +0000 (23:12 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Thu, 18 Jun 2020 20:51:30 +0000 (22:51 +0200)
galette/lib/Galette/Core/Db.php

index f0e78979273b57b6e9a2556d555f8c256b3fa1ad..35aeeb81e2205eb28ddb3a3e8998845110c260d8 100644 (file)
@@ -41,6 +41,8 @@ use Laminas\Db\Adapter\Adapter;
 use Laminas\Db\Adapter\Driver\DriverInterface;
 use Laminas\Db\Adapter\Driver\ConnectionInterface;
 use Laminas\Db\Adapter\Platform\PlatformInterface;
+use Laminas\Db\Sql\Insert;
+use Laminas\Db\Sql\Select;
 use Laminas\Db\Sql\Sql;
 
 /**
@@ -806,7 +808,7 @@ class Db
                 $msg . ' ' . $e->__toString(),
                 Analog::ERROR
             );
-            if ($this->isDuplicateException($e)) {
+            if ($sql instanceof Insert && $this->isDuplicateException($e)) {
                 throw new \OverflowException('Duplicate entry', 0, $e);
             }
             throw $e;