From 7c62835900af3caeac92b81eec8e76748c47882e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 10 Apr 2011 19:19:10 -0400 Subject: [PATCH] cache the scope for null profile --- classes/Notice.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/Notice.php b/classes/Notice.php index 0f2006e143..de45bdaae1 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -2305,7 +2305,11 @@ class Notice extends Memcached_DataObject */ function inScope($profile) { - $keypart = sprintf('notice:in-scope-for:%d:%d', $this->id, $profile->id); + if (is_null($profile)) { + $keypart = sprintf('notice:in-scope-for:%d:null', $this->id); + } else { + $keypart = sprintf('notice:in-scope-for:%d:%d', $this->id, $profile->id); + } $result = self::cacheGet($keypart);