summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/timelog_controller.rb1
-rw-r--r--test/functional/timelog_controller_test.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index f70c4d410..ce1f01298 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -130,6 +130,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 6b04e7d00..451bbaa09 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