Skip already queued worker notifications for stacked notifications
authorAlexander Ebert <ebert@woltlab.com>
Thu, 15 Aug 2024 14:52:54 +0000 (16:52 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 15 Aug 2024 14:52:54 +0000 (16:52 +0200)
See https://www.woltlab.com/community/thread/307700-fehlermeldung-beim-absenden-eines-beitrags-doppelposting/

wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php

index 9a1415c6e27c51fa27f76ed07cc95fd264b77f35..95b5fe5bbca79dadeec32ead14d454a531928fe5 100644 (file)
@@ -308,10 +308,11 @@ class UserNotificationHandler extends SingletonFactory
                 }
             }
 
-            $sql = "INSERT INTO wcf1_service_worker_notification (workerID, notificationID, time)
-                    SELECT                                        workerID, ?, ?
-                    FROM                                          wcf1_service_worker 
-                    WHERE                                         userID = ?";
+            $sql = "INSERT IGNORE INTO  wcf1_service_worker_notification
+                                        (workerID, notificationID, time)
+                    SELECT              workerID, ?, ?
+                    FROM                wcf1_service_worker
+                    WHERE               userID = ?";
             $statement = WCF::getDB()->prepare($sql);
 
             foreach ($notifications as $userID => $notification) {