From: Go MAEDA Date: Mon, 27 Apr 2020 06:33:39 +0000 (+0000) Subject: Merged r19727 from trunk to 4.1-stable (#33341). X-Git-Tag: 4.1.2~51 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=483e92eb17d834dbc55879c65fde54752895c6d0;p=redmine.git Merged r19727 from trunk to 4.1-stable (#33341). git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19728 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb index f8f36fbdd..49d78fd03 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 3b17c563b..edf28ef54 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