Fixed wrong notification order for confirmed notifications
authorAlexander Ebert <ebert@woltlab.com>
Sun, 23 Nov 2014 22:10:15 +0000 (23:10 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 23 Nov 2014 22:10:15 +0000 (23:10 +0100)
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php

index 7a32989e1dfd2c6717c3ee764ee4e1b758ac2b96..d2cc14fc185db7b68176457f51bfea606c977649 100644 (file)
@@ -341,13 +341,14 @@ class UserNotificationHandler extends SingletonFactory {
                $conditions = new PreparedStatementConditionBuilder();
                $conditions->add("notification.userID = ?", array(WCF::getUser()->userID));
                
+               $orderBy = 'notification.time DESC';
                if ($filterByConfirmed !== null) {
                        // fetch the oldest, unconfirmed notifications, order will be reversed using PHP
-                       $orderBy = 'notification.time ASC';
                        $conditions->add("notification.confirmed = ?", array($filterByConfirmed));
-               }
-               else {
-                       $orderBy = 'notification.time DESC';
+                       
+                       if ($filterByConfirmed = 0) {
+                               $orderBy = 'notification.time ASC';
+                       }
                }
                
                $sql = "SELECT          notification.*, notification_event.eventID, object_type.objectType