Fixed usage of user activity point API
authorAlexander Ebert <ebert@woltlab.com>
Fri, 12 Jul 2013 18:50:25 +0000 (20:50 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 12 Jul 2013 18:50:25 +0000 (20:50 +0200)
wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php
wcfsetup/install/files/lib/system/worker/LikeRebuildDataWorker.class.php

index 0d8fee1d9c27616ccfa995ebca8a735084e1c423..8b2e10b65655721e65bb3fecef4b77164228de75 100644 (file)
@@ -141,11 +141,6 @@ class UserActivityPointHandler extends SingletonFactory {
         * @param       array<integer>          $userToItems
         */
        public function removeEvents($objectType, array $userToItems) {
-               // ignore values for guests
-               if (isset($userToItems[0])) {
-                       unset($userToItems[0]);
-               }
-               
                if (empty($userToItems)) return;
                
                // get and validate object type
index 39770af7885389c9c6b157b698bfa3003005c655..466b541c7f505a5200178ea3a188d4f19b946d3f 100644 (file)
@@ -46,6 +46,10 @@ class LikeRebuildDataWorker extends AbstractRebuildDataWorker {
                
                $itemsToUser = array();
                foreach ($this->objectList as $like) {
+                       if (!$like->userID) {
+                               continue;
+                       }
+                       
                        if (!isset($itemsToUser[$like->objectUserID])) {
                                $itemsToUser[$like->objectUserID] = 0;
                        }