diff options
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 |