From f60fa5c954d18841d33e41850d4e84c747fe38f1 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 27 Mar 2015 23:49:18 +0100 Subject: [PATCH] fetch() must work to get this check passed. Signed-off-by: Roland Haeder --- classes/Notice_tag.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php index eb36b83410..ccf00cbb5d 100644 --- a/classes/Notice_tag.php +++ b/classes/Notice_tag.php @@ -94,8 +94,16 @@ class Notice_tag extends Managed_DataObject // 1) Get notice object and set id $notice = new Notice(); - $notice->id = $this->notice_id; - $notice->scope = $this->scope; + $notice->id = $this->notice_id; + + /* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . '] this->tag=' . $this->tag . ',this->notice_id=' . $this->notice_id . ' - Calling fetch() ...'); + + // Fetch notice + if (!$notice->fetch()) { + // No longer valid, so better don't allow to see it + return FALSE; + } + /* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . '] this->tag=' . $this->tag . ',notice->id=' . $notice->id . ',notice->scope=' . $notice->scope); // Is it private scope? -- 2.39.5