]> source.dussan.org Git - redmine.git/commitdiff
Ignore statuses in Project#rolled_up_statuses which only have an identity transition...
authorGo MAEDA <maeda@farend.jp>
Thu, 16 May 2024 07:20:19 +0000 (07:20 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 16 May 2024 07:20:19 +0000 (07:20 +0000)
Patch by Holger Just (@hjust).

git-svn-id: https://svn.redmine.org/redmine/trunk@22833 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project.rb
test/functional/reports_controller_test.rb
test/unit/project_test.rb

index 2b3280651d28d2215b3a25ef217b05bd920d9e02..909080a112d5f9bf472d942abe81ddc53fd2f584 100644 (file)
@@ -494,6 +494,7 @@ class Project < ApplicationRecord
   def rolled_up_statuses
     issue_status_ids = WorkflowTransition.
       where(:tracker_id => rolled_up_trackers.map(&:id)).
+      where('old_status_id <> new_status_id').
       distinct.
       pluck(:old_status_id, :new_status_id).
       flatten.
index 67ea188f2e79e1d69d7730e171410827205bf585..9f6624f6a8c9e9ef60e84a454e388574678426bc 100644 (file)
@@ -107,6 +107,8 @@ class ReportsControllerTest < Redmine::ControllerTest
     WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4)
     WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 2, :new_status_id => 5)
     WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 6)
+    WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 3, :new_status_id => 3)
+
     with_settings :display_subprojects_issues => '0' do
       get(:issue_report_details, :params => {:id => 1, :detail => 'tracker'})
     end
index a7047d71c0f2afb59560e572be280368e59bed71..dc7d00fe855c69f923dae8d281be355f36bc004d 100644 (file)
@@ -534,6 +534,8 @@ class ProjectTest < ActiveSupport::TestCase
     WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4)
     WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 2, :new_status_id => 3)
     WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 3)
+    WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 5, :new_status_id => 5)
+    WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 5, :new_status_id => 5)
 
     assert_kind_of IssueStatus, project.rolled_up_statuses.first
     assert_equal IssueStatus.find(1), project.rolled_up_statuses.first