Skip to content

Commit

Permalink
Fix #11293: history_default_visible not per-project in bug_view_inc.php
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
davidhicks committed Feb 20, 2010
1 parent e7fe953 commit 0c3813b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions bug_view_inc.php
Expand Up @@ -41,22 +41,21 @@
require_once( 'last_visited_api.php' );
require_once( 'tag_api.php' );

$f_bug_id = gpc_get_int( 'id' );
$f_history = gpc_get_bool( 'history', config_get( 'history_default_visible' ) );
$f_bug_id = gpc_get_int( 'id' );

bug_ensure_exists( $f_bug_id );

$tpl_bug = bug_get( $f_bug_id, true );

$t_selected_project = helper_get_current_project();
if( $tpl_bug->project_id != $t_selected_project ) {
# in case the current project is not the same project of the bug we are viewing...
# ... override the current project. This to avoid problems with categories and handlers lists etc.
$g_project_override = $tpl_bug->project_id;
}
# In case the current project is not the same project of the bug we are
# viewing, override the current project. This ensures all config_get and other
# per-project function calls use the project ID of this bug.
$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 );

Expand Down

0 comments on commit 0c3813b

Please sign in to comment.