View Issue Details

IDProjectCategoryView StatusLast Update
0011956mantisbtbugtrackerpublic2014-12-22 08:25
Reporterdjcarr Assigned Tojreese  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.1 
Target Version1.2.2Fixed in Version1.2.2 
Summary0011956: Regression in 1.2.1 : no longer obeys Default Value for Workflow Transitions
Description

The changes made in 0011729 (and blogged about at http://www.mantisbt.org/blog/?p=90 ) have caused a regression in 1.2.1.

The change in 0011729 was to make the "Change Status To" dropdown in view.php always forcefully default to the next numerically higher status. This happens to work fine for the default Mantis workflows, so the Mantis developers would not have noticed the regression. However, it causes problems for many people using a custom workflow.

For a long time there was already a mechanism in Mantis to nominate the next default status, this is accessed via Manage Configuration | Workflow Transitions and then by selecting the Default Value for the status in question. This gets stored in the status_enum_workflow configuration option as the first value.

For example, for 50 (assigned), we have:

50 => '75:repaired,20:feedback,30:acknowledged,70:deferred,77:delivered,80:resolved,90:closed',

In other words, at my site we had the default next status from 50 (assigned) configured as 75 (repaired). This worked perfectly in previous versions of Mantis. But in Mantis 1.2.1, the default next status is now 70 (deferred), completely ignoring the sequence defined in the config option.

Is it possible to revert or fix the changes made in 0011729 such that this configuration option is obeyed again?

TagsNo tags attached.

Relationships

parent of 0012089 closeddregad Define default value for $g_status_enum_workflow 
has duplicate 0012017 closeddhx Default value for status in workflow not taken into account in "Change status to" drop-down list 

Activities

dhx

dhx

2010-05-25 01:21

reporter   ~0025603

Thanks for the very descriptive bug report. I'll look into fixing this ASAP.

djcarr

djcarr

2010-05-25 01:34

reporter   ~0025604

Last edited: 2010-05-25 01:34

No probs, thanks dhx. I patched my site by modifying html_api.php:html_button_bug_change_status():

    # 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;
        }
    }

back to essentially the same code from 1.1.6:

    # resort the list into ascending order after noting the key from the first element (the default)
    $t_default_arr = each( $t_enum_list );
    $t_default = $t_default_arr['key'];
    ksort( $t_enum_list );
    reset( $t_enum_list );
dhx

dhx

2010-05-25 01:42

reporter   ~0025605

I was also thinking of setting up $g_status_enum_workflow in config_defaults_inc.php so we have sane default statuses for each stage of the default workflow.

I don't think the first status in the workflow was ever meant to be the default... it just worked out that way by chance. But now you mention the possibility, I like it, and will document it as a feature :)

We'd just need to remember to ksort() the enum list in some special cases as it can no longer be assumed that the status enum setting is linear (lowest status to highest).

djcarr

djcarr

2010-05-25 02:01

reporter   ~0025606

I think it was an intended "feature" that was sort of forgotten about at the time that the option was commented out of the config_defaults_inc.php and started to live in the database.

So new Mantis installs after that point would have defaulted to the first available status and required people to use the Workflow Transitions page to set their desired defaults, while existing installations would already have it configured in the config file and worked fine until upgraded to 1.2.1.

I agree that reverting 0011729 and setting up sane defaults in the config is the ideal solution for both new and upgraded installs.

crazya

crazya

2010-06-03 10:00

reporter   ~0025680

Thx djcarr for the workaround, works fine :)

eelcodegraaff

eelcodegraaff

2010-06-22 11:56

reporter   ~0025947

We have found here the same situation
Taking the config_inc.php here

$g_status_enumworkflow[NEW] ='50:assigned, 20:feedback';
our expectation it will show in the dropdown first Assigned and as second feedback (this is the way it worked in 1.1.x

Will this be fixed in mantis 1.2.2?

dhx

dhx

2010-07-29 10:12

reporter   ~0026163

@jreese: thanks for handling the revert.

This regression should be fixed in 1.2.2 but will need some further improvement in 0012089 to clean up this part of the code base. In particular, documentation of this functionality is important. I'll handle it as it's not urgent :)

jreese

jreese

2010-07-29 10:28

reporter   ~0026166

Revert committed to 1.2.x and master branches.

Related Changesets

MantisBT: master-1.2.x 19c2a492

2010-07-29 09:52

jreese


Details Diff
Revert "Issue 0011729: Preselect next highest status in bug_change_status"

This reverts commit 886dccd9a467c892a165e7a755a6b13d0d8ed365, and
fixes 0011956, but does not resolve the underlying issue of needing an
explicit workflow defined for the default configuration.
Affected Issues
0011729, 0011956
mod - core/html_api.php Diff File

MantisBT: master bc80ecd9

2010-07-29 10:18

jreese


Details Diff
Revert "Issue 0011729: Preselect next highest status in bug_change_status"

This reverts commit 820b45bea6be43b1eebe75da8069db76501156c0, and
fixes 0011956, but does not resolve the underlying issue of needing an
explicit workflow defined for the default configuration.
Affected Issues
0011729, 0011956
mod - core/html_api.php Diff File