From: Matthias Schmidt Date: Wed, 21 Jan 2015 20:48:01 +0000 (+0100) Subject: Fix deletion of orphaned activity events X-Git-Tag: 2.0.10_pl_1~3^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3b2f2738a60f965f1ca292051c69cbb3db2db807;p=GitHub%2FWoltLab%2FWCF.git 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). --- 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]); } }