Skip to content

Commit

Permalink
Workflow thresholds page: fix display of 'who can alter'
Browse files Browse the repository at this point in the history
When the current project is 'All projects' and the admin changes the
'Who can alter value' threshold (e.g. to 'manager'), the changes are saved
in the config table as expected, but not displayed back properly -
mantis shows the default value of 'administrator' (admin_site_threshold)
instead, giving the impression that the settings have not been saved;
another update will then overwrite the previously saved threshold back
to default.

The projects list in config_get_access() was not properly initialized,
set to an empty array when current project is ALL_PROJECTS.

Fixes #10071
  • Loading branch information
dregad committed Sep 26, 2013
1 parent f4a4e90 commit 281fa5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/config_api.php
Expand Up @@ -220,8 +220,9 @@ function config_get_access( $p_option, $p_user = null, $p_project = null ) {
$t_projects = array();
if(( null === $p_project ) && ( auth_is_user_authenticated() ) ) {
$t_selected_project = helper_get_current_project();
$t_projects[] = $t_selected_project;
if( ALL_PROJECTS <> $t_selected_project ) {
$t_projects[] = $t_selected_project;
$t_projects[] = ALL_PROJECTS;
}
}
else if( !in_array( $p_project, $t_projects ) ) {
Expand Down

0 comments on commit 281fa5e

Please sign in to comment.