Fixed like update worker
authorMarcel Werk <burntime@woltlab.com>
Wed, 11 Dec 2013 01:54:34 +0000 (02:54 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 11 Dec 2013 01:54:34 +0000 (02:54 +0100)
wcfsetup/install/files/lib/system/worker/LikeRebuildDataWorker.class.php

index d0a52e92e0c380f06057cdfbe202ded75e00ed7c..2dc041c56b08059295b9d4783a9a67d11f562bca 100644 (file)
@@ -32,7 +32,6 @@ class LikeRebuildDataWorker extends AbstractRebuildDataWorker {
                parent::initObjectList();
                
                $this->objectList->sqlOrderBy = 'like_table.objectID, like_table.likeID';
-               $this->objectList->getConditionBuilder()->add('like_table.objectUserID IS NOT NULL');
        }
        
        /**
@@ -57,12 +56,14 @@ class LikeRebuildDataWorker extends AbstractRebuildDataWorker {
                $itemsToUser = array();
                $likeObjectData = array();
                foreach ($this->objectList as $like) {
-                       if (!isset($itemsToUser[$like->objectUserID])) {
-                               $itemsToUser[$like->objectUserID] = 0;
+                       if ($like->objectUserID) {
+                               if (!isset($itemsToUser[$like->objectUserID])) {
+                                       $itemsToUser[$like->objectUserID] = 0;
+                               }
+                               
+                               $itemsToUser[$like->objectUserID]++;
                        }
                        
-                       $itemsToUser[$like->objectUserID]++;
-                       
                        if (!isset($likeObjectData[$like->objectTypeID])) {
                                $likeObjectData[$like->objectTypeID] = array();
                        }