Salut,

Le 19/06/2024 à 09:10, tezorc a écrit :
Est-il possible que ce patch renseigne un log pour identifié l'utilisateur?

Essaie avec le patch joint.

Il est un peu plus fourni que le patch d'origine, mais (au moins dans certains cas) une erreur qui semblait sans rapport était déclenchée - et on avait pas l'information souhaitée...

J'espère que ça aidera.

++
--
Johan
diff --git a/galette/lib/Galette/Core/Preferences.php b/galette/lib/Galette/Core/Preferences.php
index ac9e8e48a..5d6ea5dea 100644
--- a/galette/lib/Galette/Core/Preferences.php
+++ b/galette/lib/Galette/Core/Preferences.php
@@ -864,7 +864,9 @@ class Preferences
 
             return true;
         } catch (Throwable $e) {
-            $this->zdb->connection->rollBack();
+            if ($this->zdb->connection->inTransaction()) {
+                $this->zdb->connection->rollBack();
+            }
 
             $messages = array();
             do {
diff --git a/galette/lib/Galette/Features/Socials.php b/galette/lib/Galette/Features/Socials.php
index f2b4b50c4..d37b754d8 100644
--- a/galette/lib/Galette/Features/Socials.php
+++ b/galette/lib/Galette/Features/Socials.php
@@ -93,6 +93,17 @@ trait Socials
         }
 
         if (count($existings)) {
+            global $login;
+            if ($id === null) {
+                $user = $login->isSuperAdmin() ? 'superadmin' : $login->login;
+                throw new \Exception(
+                    sprintf(
+                        'Attempt to remove preferences social networks (user %s - #%s)!',
+                        $user,
+                        $login->id
+                    )
+                );
+            }
             $social = new Social($this->zdb);
             $social->remove(array_keys($existings));
         }
_______________________________________________
Galette-users mailing list -- galette-users@mailman3.com
To unsubscribe send an email to galette-users-le...@mailman3.com

Reply via email to