From: Matthias Schmidt Date: Sun, 4 Sep 2016 17:18:22 +0000 (+0200) Subject: Fix point of determination of last event time X-Git-Tag: 3.0.0_Beta_1~315 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2df9068be5d41d7f4e3ef9f9a14d8d4b1820369c;p=GitHub%2FWoltLab%2FWCF.git Fix point of determination of last event time It has to be determined after truncation so that only the truncated objects are considered. --- diff --git a/wcfsetup/install/files/lib/page/RecentActivityListPage.class.php b/wcfsetup/install/files/lib/page/RecentActivityListPage.class.php index e5389161e3..135e5e936c 100644 --- a/wcfsetup/install/files/lib/page/RecentActivityListPage.class.php +++ b/wcfsetup/install/files/lib/page/RecentActivityListPage.class.php @@ -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 ]); } diff --git a/wcfsetup/install/files/lib/system/menu/user/profile/content/RecentActivityUserProfileMenuContent.class.php b/wcfsetup/install/files/lib/system/menu/user/profile/content/RecentActivityUserProfileMenuContent.class.php index 1e34b9f62c..da55f79d6f 100644 --- a/wcfsetup/install/files/lib/system/menu/user/profile/content/RecentActivityUserProfileMenuContent.class.php +++ b/wcfsetup/install/files/lib/system/menu/user/profile/content/RecentActivityUserProfileMenuContent.class.php @@ -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 ]);