Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0012017mantisbtbugtrackerpublic2011-08-05 02:12
Reporterfxm Assigned Todhx  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version1.2.1 
Summary0012017: Default value for status in workflow not taken into account in "Change status to" drop-down list
Description

The default value specified in section "worklow" of "Workflow transition" screen is not the selected value in drop down list near the "Change Status To" button in the issue detail screen.

TagsNo tags attached.

Relationships

duplicate of 0011956 closedjreese Regression in 1.2.1 : no longer obeys Default Value for Workflow Transitions 

Activities

fxm

fxm

2010-06-09 03:53

reporter   ~0025778

Last edited: 2010-06-09 03:55

I solve this problem by replacing the code in core/html_api.php. In fact, I take back the code of Mantis 1.1.8


function html_button_bug_change_status( $p_bug_id ) {
$t_bug_project_id = bug_get_field( $p_bug_id, 'project_id' );
$t_bug_current_state = bug_get_field( $p_bug_id, 'status' );
$t_current_access = access_get_project_level( $t_bug_project_id );

$t_enum_list = get_status_option_list( $t_current_access, $t_bug_current_state, false, ( bug_get_field( $p_bug_id, 'reporter_id' ) == auth_get_current_user_id() && ( ON == config_get( 'allow_reporter_close' ) ) ), $t_bug_project_id );

if( count( $t_enum_list ) > 0 ) {
  • resort the list into ascending order

  • ksort( $t_enum_list );

  • Get the default selected option as the next highest available status

  • Otherwise fall back to using the last element in the array

  • end( $t_enum_list );

  • $t_default = key( $t_enum_list );

  • reset( $t_enum_list );

  • foreach( $t_enum_list as $key => $val ) {

  • if( $key > $t_bug_current_state ) {

  • $t_default = $key;

  • break;

  • }

  • }

  • $t_default_arr = each( $t_enum_list );

  • $t_default = $t_default_arr['key'];

  • ksort( $t_enum_list );

  • reset( $t_enum_list );