Fix point of determination of last event time
authorMatthias Schmidt <gravatronics@live.com>
Sun, 4 Sep 2016 17:18:22 +0000 (19:18 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 4 Sep 2016 17:18:22 +0000 (19:18 +0200)
It has to be determined after truncation so that only the truncated
objects are considered.

wcfsetup/install/files/lib/page/RecentActivityListPage.class.php
wcfsetup/install/files/lib/system/menu/user/profile/content/RecentActivityUserProfileMenuContent.class.php

index e5389161e39e3cddcdb3fdd7929d82eb2969ac85..135e5e936c1439ee180344ccbc08636111b800cd 100644 (file)
@@ -53,17 +53,15 @@ class RecentActivityListPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               $lastEventTime = $this->eventList->getLastEventTime();
-               
                // removes orphaned and non-accessible events
                UserActivityEventHandler::validateEvents($this->eventList);
                
                // remove unused items
                $this->eventList->truncate(20);
-                               
+               
                WCF::getTPL()->assign([
                        'eventList' => $this->eventList,
-                       'lastEventTime' => $lastEventTime,
+                       'lastEventTime' => $this->eventList->getLastEventTime(),
                        'allowSpidersToIndexThisPage' => true
                ]);
        }
index 1e34b9f62ccaf2445d162c7c58dae15f5b958dc7..da55f79d6fb055fc91c8bb306f92d32448e30018 100644 (file)
@@ -26,17 +26,14 @@ class RecentActivityUserProfileMenuContent extends SingletonFactory implements I
                $eventList->getConditionBuilder()->add("user_activity_event.userID = ?", [$userID]);
                $eventList->readObjects();
                
-               $lastEventTime = $eventList->getLastEventTime();
-               if ($lastEventTime) {
-                       UserActivityEventHandler::validateEvents($eventList);
-               }
+               UserActivityEventHandler::validateEvents($eventList);
                
                // remove unused items
                $eventList->truncate(20);
                
                WCF::getTPL()->assign([
                        'eventList' => $eventList,
-                       'lastEventTime' => $lastEventTime,
+                       'lastEventTime' => $eventList->getLastEventTime(),
                        'placeholder' => WCF::getLanguage()->get('wcf.user.profile.content.recentActivity.noEntries'),
                        'userID' => $userID
                ]);