From 953fce3c95d383a85c8d9dd7dd8f3865ffca8515 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 27 Apr 2020 06:19:26 +0000 Subject: Fix time entry user is shown twice in the User drop-down (#33341). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Thomas Löber and Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@19727 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/timelog_helper.rb | 2 +- test/functional/timelog_controller_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb index 6fa0e0442..31b8705c0 100644 --- a/app/helpers/timelog_helper.rb +++ b/app/helpers/timelog_helper.rb @@ -44,7 +44,7 @@ module TimelogHelper def user_collection_for_select_options(time_entry) collection = time_entry.assignable_users - collection << time_entry.user unless time_entry.user.nil? && !collection.include?(time_entry.user) + collection << time_entry.user if time_entry.user && !collection.include?(time_entry.user) principals_options_for_select(collection, time_entry.user_id.to_s) end diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index ae8a692f0..3b7e10bde 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -226,7 +226,7 @@ class TimelogControllerTest < Redmine::ControllerTest assert_response :success assert_select 'select[name=?]', 'time_entry[user_id]' do - assert_select 'option[value="2"][selected=selected]' + assert_select 'option[value="2"][selected=selected]', 1 end end -- cgit v1.2.3