Fixes issue with tag cache builder
authorMatthias Schmidt <gravatronics@live.com>
Sat, 12 Oct 2013 08:28:39 +0000 (10:28 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 12 Oct 2013 08:28:39 +0000 (10:28 +0200)
Since cache builders are singletons, before reading tags, the previously read tags need to be removed, i.e. `$tags` needs to be emptied.

wcfsetup/install/files/lib/system/cache/builder/TagCloudCacheBuilder.class.php

index 57e8d6f8cdf565f4c5352a68b934b64582167419..7a6a0c33d9fea940b4176ffd7a43de4ffc107085 100644 (file)
@@ -78,6 +78,8 @@ class TagCloudCacheBuilder extends AbstractCacheBuilder {
         * Reads associated tags.
         */
        protected function getTags() {
+               $this->tags = array();
+               
                if (!empty($this->objectTypeIDs)) {
                        // get tag ids
                        $tagIDs = array();
@@ -86,7 +88,7 @@ class TagCloudCacheBuilder extends AbstractCacheBuilder {
                        $conditionBuilder->add('object.languageID IN (?)', array($this->languageIDs));
                        $sql = "SELECT          COUNT(*) AS counter, object.tagID
                                FROM            wcf".WCF_N."_tag_to_object object
-                               ".$conditionBuilder->__toString()."
+                               ".$conditionBuilder."
                                GROUP BY        object.tagID
                                ORDER BY        counter DESC";
                        $statement = WCF::getDB()->prepareStatement($sql, 500);