From c6906c102004434344e5cfd0c8b66506c0c31b45 Mon Sep 17 00:00:00 2001 From: Chris Fitch Date: Fri, 18 Dec 2009 14:26:46 -0500 Subject: [PATCH] Issue #11293: Fix for project specific config options on view report page. Reset project in config_get() if overridden since last call. Also don't get config options in bug_view_inc.php until project is overridden. diff --git a/bug_view_inc.php b/bug_view_inc.php index 55a2264..c213c99 100644 --- a/bug_view_inc.php +++ b/bug_view_inc.php @@ -42,12 +42,9 @@ require_once( 'tag_api.php' ); $f_bug_id = gpc_get_int( 'id' ); - $f_history = gpc_get_bool( 'history', config_get( 'history_default_visible' ) ); bug_ensure_exists( $f_bug_id ); - access_ensure_bug_level( VIEWER, $f_bug_id ); - $tpl_bug = bug_get( $f_bug_id, true ); $t_selected_project = helper_get_current_project(); @@ -57,6 +54,10 @@ $g_project_override = $tpl_bug->project_id; } + access_ensure_bug_level( VIEWER, $f_bug_id ); + + $f_history = gpc_get_bool( 'history', config_get( 'history_default_visible' ) ); + $t_fields = config_get( $tpl_fields_config_option ); $t_fields = columns_filter_disabled( $t_fields ); diff --git a/core/config_api.php b/core/config_api.php index e5c435a..daff750 100644 --- a/core/config_api.php +++ b/core/config_api.php @@ -54,7 +54,7 @@ $g_cache_config_project = null; # 3.use GLOBAL[config_id] function config_get( $p_option, $p_default = null, $p_user = null, $p_project = null ) { global $g_cache_config, $g_cache_config_access, $g_cache_db_table_exists, $g_cache_filled; - global $g_cache_config_user, $g_cache_config_project; + global $g_cache_config_user, $g_cache_config_project, $g_project_override; # @@ debug @@ echo "lu o=$p_option "; # bypass table lookup for certain options @@ -97,7 +97,7 @@ function config_get( $p_option, $p_default = null, $p_user = null, $p_project = # prepare the projects list $t_projects = array(); if(( null === $p_project ) ) { - if( !isset( $g_cache_config_project ) ) { + if( !isset( $g_cache_config_project ) || ( isset( $g_project_override ) && !in_array( $g_project_override, $g_cache_config_project ) ) ) { $t_projects[] = auth_is_user_authenticated() ? helper_get_current_project() : ALL_PROJECTS; if( !in_array( ALL_PROJECTS, $t_projects ) ) { $t_projects[] = ALL_PROJECTS; -- 1.6.0.4