Patch #37636

Ignore statuses if workflow only defines identity transition

Added by Holger Just 27 days ago. Updated 11 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Issues workflow
Target version:5.1.0

Description

When editing workflow transitions, we are implicitly storing identity transitions (from a status to the same status, i.e. old_status_id == @new_status_id). These transition rules are created because the editor renders (disabled) checked checkboxes for those.

These transitions however are not removed when

  • checking for statuses used by a workflow (which thus causes any statuses which where previously used in a workflow to always be included in the workflows editor, even when "Only display statuses that are used by this tracker" is checked)
  • as well as when getting a list of statuses in use by a tracker in Tracker#issue_statuses

As the checkboxes for the identity transitions are disabled, those statuses can not be removed by admins.

The attached patch filters the returned statuses by ignoring the identity transitions and only considering transitions for a status to a different status.

Note that for issues, the current status of an issue is generally still allowed. This is ensured by a custom rule for the initial_status in Issue#new_statuses_allowed_to. Thus, the identity transitions are not required to be in the database for this to work.

Associated revisions

Revision 21818
Added by Go MAEDA 11 days ago

Ignore statuses if workflow only defines identity transition (#37636).

Patch by Holger Just.

History

#1 Updated by Go MAEDA 15 days ago

  • Target version set to 5.1.0

Setting the target version to 5.1.0.

#2 Updated by Go MAEDA 11 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the fix. Thank you.

Also available in: Atom PDF