View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011293 | mantisbt | customization | public | 2009-12-18 09:39 | 2010-02-22 14:35 |
Reporter | cmfitch1 | Assigned To | jreese | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Fixed in Version | 1.2.0 | ||||
Summary | 0011293: View report page is ignoring project specific config settings | ||||
Description | Project specific configuration options don't work right on the view report page. Near the top of bug_view_inc.php, the current project is overridden to be the project that the report is written up under. This setting has no effect as related to configuration options, however. The config_get() function has already been called by the time the override is done, and the current project has been cached as the one that the user is navigated to. | ||||
Tags | No tags attached. | ||||
Attached Files | issue_11293.patch (2,385 bytes)
From c6906c102004434344e5cfd0c8b66506c0c31b45 Mon Sep 17 00:00:00 2001 From: Chris Fitch <cfitch@redcom.com> 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 | ||||
Final fixes committed to 1.2.x and master branches. |
|
bug_view_inc.php still has a call to config_get( 'history_default_visible' ) prior to setting the project override. This causes the view report page to ignore the override and use the current project. There is also a config_get() called conditionally in helper_get_current_project() that might cause issues. Maybe the project override should always be set in bug_view_inc.php instead of checking the current project first. |
|
Thanks Chris, I've committed a fix. We don't need the helper_get_current_project function at all... we can just set the override regardless. |
|
MantisBT: master c2bf8fb8 2009-12-22 18:05 Paul Richards Details Diff |
Fix part of 0011293 - if we have a project_override set, that should lead to the same behaviour as calling config_get with a project id |
Affected Issues 0011293 |
|
mod - core/config_api.php | Diff File | ||
MantisBT: master 8c404a18 2009-12-22 18:25 Paul Richards Details Diff |
Fix part of 0011293 - if we have a project_override set, that should lead to the same behaviour as calling config_get with a project id |
Affected Issues 0011293 |
|
mod - core/config_api.php | Diff File | ||
MantisBT: master-1.2.x c15dc49d 2009-12-31 15:01 Details Diff |
Fix 0011293: Obey project overrides for configs When setting $g_project_override, any calls to config or access apis should wait until after the override is set in cases where the current project may have different configurations than the project for the currently viewed issue. |
Affected Issues 0011293 |
|
mod - bug_set_sponsorship.php | Diff File | ||
mod - bug_relationship_delete.php | Diff File | ||
mod - summary_page.php | Diff File | ||
mod - bugnote_view_inc.php | Diff File | ||
mod - bug_relationship_graph.php | Diff File | ||
mod - bug_file_add.php | Diff File | ||
mod - bug_view_inc.php | Diff File | ||
mod - bug_assign_reporter.php | Diff File | ||
mod - print_bug_page.php | Diff File | ||
mod - bug_reminder_page.php | Diff File | ||
mod - bug_reminder.php | Diff File | ||
mod - bugnote_edit_page.php | Diff File | ||
mod - bug_file_delete.php | Diff File | ||
MantisBT: master ce604f90 2009-12-31 15:01 Details Diff |
Fix 0011293: Obey project overrides for configs When setting $g_project_override, any calls to config or access apis should wait until after the override is set in cases where the current project may have different configurations than the project for the currently viewed issue. |
Affected Issues 0011293 |
|
mod - bug_set_sponsorship.php | Diff File | ||
mod - summary_page.php | Diff File | ||
mod - bug_relationship_delete.php | Diff File | ||
mod - bug_file_add.php | Diff File | ||
mod - bug_view_inc.php | Diff File | ||
mod - bug_assign_reporter.php | Diff File | ||
mod - bugnote_view_inc.php | Diff File | ||
mod - bug_reminder_page.php | Diff File | ||
mod - print_bug_page.php | Diff File | ||
mod - bug_reminder.php | Diff File | ||
mod - bugnote_edit_page.php | Diff File | ||
mod - bug_file_delete.php | Diff File | ||
mod - bug_relationship_graph.php | Diff File | ||
MantisBT: master-1.2.x 0c3813ba 2010-02-19 22:23 Details Diff |
Fix 0011293: history_default_visible not per-project in bug_view_inc.php bug_view_inc.php sets the project override ($g_project_override) after getting the configuration option history_default_visible. Thus the configuration option history_default_visible will be retrieved using the wrong project (the one which is currently selected by the user cookie, rather than the project of the bug the user is viewing). Thanks to Chris Fitch for detecting this problem. |
Affected Issues 0011293 |
|
mod - bug_view_inc.php | Diff File | ||
MantisBT: master 3242eac5 2010-02-19 22:23 Details Diff |
Fix 0011293: history_default_visible not per-project in bug_view_inc.php bug_view_inc.php sets the project override ($g_project_override) after getting the configuration option history_default_visible. Thus the configuration option history_default_visible will be retrieved using the wrong project (the one which is currently selected by the user cookie, rather than the project of the bug the user is viewing). Thanks to Chris Fitch for detecting this problem. |
Affected Issues 0011293 |
|
mod - bug_view_inc.php | Diff File |