From: Go MAEDA Date: Sat, 18 May 2024 04:58:15 +0000 (+0000) Subject: Merged r22833 to 5.1-stable (#40693). X-Git-Tag: 5.1.3~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=347e21ead845101d3fa5ee54ae218d968aea9b8e;p=redmine.git Merged r22833 to 5.1-stable (#40693). git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22836 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/project.rb b/app/models/project.rb index 9f9656976..08fdefabd 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -492,6 +492,7 @@ class Project < ActiveRecord::Base 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. diff --git a/test/functional/reports_controller_test.rb b/test/functional/reports_controller_test.rb index 67ea188f2..9f6624f6a 100644 --- a/test/functional/reports_controller_test.rb +++ b/test/functional/reports_controller_test.rb @@ -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 diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb index eacbf0c92..291ce2ff3 100644 --- a/test/unit/project_test.rb +++ b/test/unit/project_test.rb @@ -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