From b49766d647801c4a804fe0fd28f9645f84d2a8d5 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 17882c60d8..8e1c4ec128 100644 --- a/classes/Notice_tag.php +++ b/classes/Notice_tag.php @@ -95,8 +95,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