From 3b2f2738a60f965f1ca292051c69cbb3db2db807 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 21 Jan 2015 21:48:01 +0100 Subject: [PATCH] Fix deletion of orphaned activity events Initially, an activity event is neither accessible nor orphaned. If an orphaned activity event is detected, it is simply set as orphaned but internally it is also still marked as not accessible. Therefore, we need to first check if an event is an orphan and only afterwards if it is accessible (an accessible, but orphaned event makes no sense). --- .../activity/event/ViewableUserActivityEventList.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/data/user/activity/event/ViewableUserActivityEventList.class.php b/wcfsetup/install/files/lib/data/user/activity/event/ViewableUserActivityEventList.class.php index 886a2286ca..bce139c1cd 100644 --- a/wcfsetup/install/files/lib/data/user/activity/event/ViewableUserActivityEventList.class.php +++ b/wcfsetup/install/files/lib/data/user/activity/event/ViewableUserActivityEventList.class.php @@ -110,11 +110,11 @@ class ViewableUserActivityEventList extends UserActivityEventList { $orphanedEventIDs = array(); foreach ($this->objects as $index => $event) { - if (!$event->isAccessible()) { + if ($event->isOrphaned()) { + $orphanedEventIDs[] = $event->eventID; unset($this->objects[$index]); } - else if ($event->isOrphaned()) { - $orphanedEventIDs[] = $event->eventID; + else if (!$event->isAccessible()) { unset($this->objects[$index]); } } -- 2.20.1