diff options
author | Go MAEDA <maeda@farend.jp> | 2022-10-31 09:04:46 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-10-31 09:04:46 +0000 |
commit | e1928aaf1944559ce3fd5594fe0988d42719c689 (patch) | |
tree | 45b55a35280d0ae43442b23b3f32ad92edba21e5 /app/helpers/issues_helper.rb | |
parent | e881e11021528b8da32b7ea0c093a866f981300d (diff) | |
download | redmine-e1928aaf1944559ce3fd5594fe0988d42719c689.tar.gz redmine-e1928aaf1944559ce3fd5594fe0988d42719c689.zip |
Read-only field permission for the project field is ignored if the current project has subprojects (#37685).
Patch by salman mp.
git-svn-id: https://svn.redmine.org/redmine/trunk@21937 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/issues_helper.rb')
-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 de4ca4435..dfe577650 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 |