From: Go MAEDA Date: Thu, 25 Mar 2021 01:42:00 +0000 (+0000) Subject: Show project tree instead of subprojects in the project selector when you create... X-Git-Tag: 4.2.0~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=319e8a2620e43ac4997bb76735f33fc12b92b46d;p=redmine.git Show project tree instead of subprojects in the project selector when you create a new issue (#34798). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20840 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 363d970c8..4651a9258 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -748,7 +748,7 @@ module IssuesHelper 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, 'descendants') + issue.allowed_target_projects(User.current, 'tree') else issue.allowed_target_projects(User.current) end diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index dd85bb5d1..31b67c753 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -3203,16 +3203,16 @@ class IssuesControllerTest < Redmine::ControllerTest get( :new, :params => { - :project_id => 1, + :project_id => 3, :tracker_id => 1 } ) assert_response :success assert_select 'select[name="issue[project_id]"]' do assert_select 'option', 3 - assert_select 'option[selected=selected]', :text => 'eCookbook' + assert_select 'option[value=?]', '1', :text => 'eCookbook' assert_select 'option[value=?]', '5', :text => '  » Private child of eCookbook' - assert_select 'option[value=?]', '3', :text => '  » eCookbook Subproject 1' + assert_select 'option[selected=selected][value=?]', '3', :text => '  » eCookbook Subproject 1' # user_id 2 is not allowed to add issues on project_id 4 (it's not a member) assert_select 'option[value=?]', '4', 0