X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FProfile_tag.php;h=00585280d3153146e885c6a10b9eae5ba8a0ad5a;hb=3ba4258f9e13d6ba84dd21197782303ac26b28fd;hp=17f5034ff946034d45f3e6491652918665dd3c00;hpb=5304373b0b5c9905b30c85b565c23246d377467b;p=quix0rs-gnu-social.git diff --git a/classes/Profile_tag.php b/classes/Profile_tag.php index 17f5034ff9..00585280d3 100644 --- a/classes/Profile_tag.php +++ b/classes/Profile_tag.php @@ -224,7 +224,9 @@ class Profile_tag extends Memcached_DataObject Event::handle('EndUntagProfile', array($orig)); if ($result) { $profile_list = Profile_list::pkeyGet(array('tag' => $tag, 'tagger' => $tagger)); - $profile_list->taggedCount(true); + if (!empty($profile_list)) { + $profile_list->taggedCount(true); + } self::blowCaches($tagger, $tagged); return true; } @@ -289,4 +291,26 @@ class Profile_tag extends Memcached_DataObject } return true; } + + function insert() + { + $result = parent::insert(); + if ($result) { + self::blow('profile_list:tagged_count:%d:%s', + $this->tagger, + $this->tag); + } + return $result; + } + + function delete() + { + $result = parent::delete(); + if ($result) { + self::blow('profile_list:tagged_count:%d:%s', + $this->tagger, + $this->tag); + } + return $result; + } }