TagSub doesn't refetch empty set of tag subscriptions
This commit is contained in:
		@@ -146,18 +146,18 @@ class TagSub extends Managed_DataObject
 | 
				
			|||||||
        $keypart = sprintf('tagsub:by_profile:%d', $profile->id);
 | 
					        $keypart = sprintf('tagsub:by_profile:%d', $profile->id);
 | 
				
			||||||
        $tagstring = self::cacheGet($keypart);
 | 
					        $tagstring = self::cacheGet($keypart);
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if ($tagstring !== false && !empty($tagstring)) {
 | 
					        if ($tagstring !== false) { // cache hit
 | 
				
			||||||
 | 
					        	if (!empty($tagstring)) {
 | 
				
			||||||
            	$tags = explode(',', $tagstring);
 | 
					            	$tags = explode(',', $tagstring);
 | 
				
			||||||
 | 
					        	}
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            $tagsub             = new TagSub();
 | 
					            $tagsub             = new TagSub();
 | 
				
			||||||
            $tagsub->profile_id = $profile->id;
 | 
					            $tagsub->profile_id = $profile->id;
 | 
				
			||||||
 | 
					            $tagsub->selectAdd();
 | 
				
			||||||
 | 
					            $tagsub->selectAdd('tag');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ($tagsub->find()) {
 | 
					            if ($tagsub->find()) {
 | 
				
			||||||
                while ($tagsub->fetch()) {
 | 
									$tags = $tagsub->fetchAll('tag');
 | 
				
			||||||
                    if (!empty($tagsub->tag)) {
 | 
					 | 
				
			||||||
                        $tags[] = $tagsub->tag;
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            self::cacheSet($keypart, implode(',', $tags));
 | 
					            self::cacheSet($keypart, implode(',', $tags));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user