From d4b7f5d8acb0ebe9eb53a180a54285422beb4b19 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 4 Jul 2011 12:39:57 -0400 Subject: [PATCH] TagSub doesn't refetch empty set of tag subscriptions --- plugins/TagSub/TagSub.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/TagSub/TagSub.php b/plugins/TagSub/TagSub.php index a03be48ac3..c0c4c1ec86 100644 --- a/plugins/TagSub/TagSub.php +++ b/plugins/TagSub/TagSub.php @@ -146,18 +146,18 @@ class TagSub extends Managed_DataObject $keypart = sprintf('tagsub:by_profile:%d', $profile->id); $tagstring = self::cacheGet($keypart); - if ($tagstring !== false && !empty($tagstring)) { - $tags = explode(',', $tagstring); + if ($tagstring !== false) { // cache hit + if (!empty($tagstring)) { + $tags = explode(',', $tagstring); + } } else { - $tagsub = new TagSub(); + $tagsub = new TagSub(); $tagsub->profile_id = $profile->id; + $tagsub->selectAdd(); + $tagsub->selectAdd('tag'); if ($tagsub->find()) { - while ($tagsub->fetch()) { - if (!empty($tagsub->tag)) { - $tags[] = $tagsub->tag; - } - } + $tags = $tagsub->fetchAll('tag'); } self::cacheSet($keypart, implode(',', $tags)); -- 2.39.5