From: Go MAEDA Date: Wed, 15 Feb 2023 00:24:13 +0000 (+0000) Subject: Merged r22096 from trunk to 5.0-stable (#35066). X-Git-Tag: 5.0.5~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=712ec961748e130ff1f7d279cd7b350a3f460b7b;p=redmine.git Merged r22096 from trunk to 5.0-stable (#35066). git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22109 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index 313612b8b..e6848de7e 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -131,6 +131,7 @@ class TimelogController < ApplicationController :back_url => params[:back_url] } if params[:project_id] && @time_entry.project + options[:time_entry][:project_id] ||= @time_entry.project.id redirect_to new_project_time_entry_path(@time_entry.project, options) elsif params[:issue_id] && @time_entry.issue redirect_to new_issue_time_entry_path(@time_entry.issue, options) diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 9046e30a6..128cdc53b 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -458,7 +458,7 @@ class TimelogControllerTest < Redmine::ControllerTest }, :continue => '1' } - assert_redirected_to '/projects/ecookbook/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=&time_entry%5Bspent_on%5D=2008-03-14' + assert_redirected_to '/projects/ecookbook/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=1&time_entry%5Bspent_on%5D=2008-03-14' end end