From 5d1a57f8c0e15dc3e771d382f5189578e908da9a Mon Sep 17 00:00:00 2001 From: Victor Boctor Date: Sat, 15 Nov 2014 13:38:57 -0800 Subject: [PATCH] Fix bug doesn't exist error in timeline feature The error was caused by 0f030fd725b8139aa39e47365fe3433a2f12dda8 which checks that the user has access to issues referenced in issue history. Issue #9885 Conflicts: core/history_api.php --- core/history_api.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/history_api.php b/core/history_api.php index 5910060c19..caf0fecda7 100644 --- a/core/history_api.php +++ b/core/history_api.php @@ -237,7 +237,11 @@ function history_get_raw_events_array( $p_bug_id, $p_user_id = null ) { # relationships if( $v_type == BUG_ADD_RELATIONSHIP || $v_type == BUG_DEL_RELATIONSHIP || $v_type == BUG_REPLACE_RELATIONSHIP ) { - if( !access_has_bug_level( VIEWER, $v_new_value, $t_user_id ) ) { + $t_related_bug_id = $v_new_value; + + # If bug doesn't exist, then we don't know whether to expose it or not based on the fact whether it was + # accessible to user or not. This also simplifies client code that is accessing the history log. + if( !bug_exists( $t_related_bug_id ) || !access_has_bug_level( VIEWER, $t_related_bug_id, $t_user_id ) ) { continue; } }