diff options
author | Go MAEDA <maeda@farend.jp> | 2022-11-07 02:37:04 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-11-07 02:37:04 +0000 |
commit | 57956890106e72a0fffa99ba8bedd522920ecb21 (patch) | |
tree | d44066a17f3c8d9b72018a1bc4fce95c95c6632c /app | |
parent | 6b5432ef7f5fae0220f563b781bcee6400a09409 (diff) | |
download | redmine-57956890106e72a0fffa99ba8bedd522920ecb21.tar.gz redmine-57956890106e72a0fffa99ba8bedd522920ecb21.zip |
Merged r21937 from trunk to 5.0-stable (#37685).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21953 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/issues_helper.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index a64aca0e3..fbb8f7e73 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -764,12 +764,18 @@ module IssuesHelper end def projects_for_select(issue) - if issue.parent_issue_id.present? - issue.allowed_target_projects_for_subtask(User.current) - elsif @project && issue.new_record? && !issue.copy? - issue.allowed_target_projects(User.current, 'tree') + projects = + if issue.parent_issue_id.present? + issue.allowed_target_projects_for_subtask(User.current) + elsif @project && issue.new_record? && !issue.copy? + issue.allowed_target_projects(User.current, 'tree') + else + issue.allowed_target_projects(User.current) + end + if issue.read_only_attribute_names(User.current).include?('project_id') + params['project_id'].present? ? Project.where(identifier: params['project_id']) : projects else - issue.allowed_target_projects(User.current) + projects end end end |