Project

General

Profile

Feature #43997 » 0001-Add-setting-to-always-include-issue-authors-in-assig.patch

Go MAEDA, 2026-07-05 11:02

View differences:

app/models/issue.rb
return [] if project.nil?
users = project.assignable_users(tracker).to_a
users << author if author && author.active?
if Setting.always_add_issue_author_to_assignable_users? && author&.active?
users << author
end
if assigned_to_id_was.present? && assignee = Principal.find_by_id(assigned_to_id_was)
users << assignee
end
app/views/settings/_issues.html.erb
<p><%= setting_select :assignee_dropdown_display_format, assignee_dropdown_display_format_options %></p>
<p><%= setting_check_box :always_add_issue_author_to_assignable_users %></p>
<p><%= setting_check_box :default_issue_start_date_to_creation_date %></p>
<%
config/locales/en.yml
setting_gantt_months_limit: Maximum number of months displayed on the gantt chart
setting_issue_group_assignment: Allow issue assignment to groups
setting_assignee_dropdown_display_format: Assignee drop-down display format
setting_always_add_issue_author_to_assignable_users: Always show the author in the assignee list
setting_default_issue_start_date_to_creation_date: Use current date as start date for new issues
setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed
setting_unsubscribe: Allow users to delete their own account
config/settings.yml
default: 0
assignee_dropdown_display_format:
default: users_then_groups
always_add_issue_author_to_assignable_users:
default: 0
default_issue_start_date_to_creation_date:
default: 0
default_issue_due_date_offset:
test/unit/issue_test.rb
assert_kind_of User, Issue.find(1).assignable_users.first
end
test "#assignable_users should include the issue author" do
test "#assignable_users should include the issue author when enabled by settings" do
non_project_member = User.generate!
issue = Issue.generate!(:author => non_project_member)
assert issue.assignable_users.include?(non_project_member)
with_settings :always_add_issue_author_to_assignable_users => '1' do
assert issue.assignable_users.include?(non_project_member)
end
end
test "#assignable_users should not include non member author" do
non_project_member = User.generate!
issue = Issue.generate!(:author => non_project_member)
assert_not_include non_project_member, issue.assignable_users
end
def test_assignable_users_should_not_include_anonymous_user
(2-2/3)