Fix issue when dismissing dismissed notice
authorMatthias Schmidt <gravatronics@live.com>
Wed, 24 Feb 2016 06:34:51 +0000 (07:34 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 24 Feb 2016 06:34:51 +0000 (07:34 +0100)
This can happen if the notice is dismissed in two tabs one at a time.

wcfsetup/install/files/lib/data/notice/NoticeAction.class.php

index 165ca3a3bc42b1e3ab7b42f9e51aa4787ed4c64a..bc32de678484c0bd229fc9035a1325416719e941 100644 (file)
@@ -72,9 +72,9 @@ class NoticeAction extends AbstractDatabaseObjectAction implements ISortableActi
         */
        public function dismiss() {
                if (WCF::getUser()->userID) {
-                       $sql = "INSERT INTO     wcf".WCF_N."_notice_dismissed
-                                               (noticeID, userID)
-                               VALUES          (?, ?)";
+                       $sql = "INSERT IGNORE INTO      wcf".WCF_N."_notice_dismissed
+                                                       (noticeID, userID)
+                               VALUES                  (?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute(array(
                                reset($this->objectIDs),