Thanks for the patch, I fixed for Redmine v3.4.4
Hope this feature can be merged into redmine master.
--- versions_controller.rb.old 2019-03-06 13:43:41.068549228 +0800
+++ versions_controller.rb 2019-03-06 14:32:04.942060762 +0800
@@ -49,10 +49,10 @@
@issues_by_version = {}
if @selected_tracker_ids.any? && @versions.any?
issues = Issue.visible.
- includes(:project, :tracker).
+ includes(:project, :tracker, :status).
preload(:status, :priority, :fixed_version).
where(:tracker_id => @selected_tracker_ids, :project_id => project_ids, :fixed_version_id => @versions.map(&:id)).
- order("#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id")
+ order("#{Project.table_name}.lft, #{Tracker.table_name}.position, #{IssueStatus.table_name}.position, #{Issue.table_name}.id")
@issues_by_version = issues.group_by(&:fixed_version)
end
@versions.reject! {|version| !project_ids.include?(version.project_id) && @issues_by_version[version].blank?}
@@ -69,7 +69,7 @@
@issues = @version.fixed_issues.visible.
includes(:status, :tracker, :priority).
preload(:project).
- reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
+ reorder("#{Tracker.table_name}.position, #{IssueStatus.table_name}.position, #{Issue.table_name}.id").
to_a
}
format.api