]> source.dussan.org Git - redmine.git/commitdiff
Merged r22096 from trunk to 4.2-stable (#35066).
authorGo MAEDA <maeda@farend.jp>
Wed, 15 Feb 2023 00:26:20 +0000 (00:26 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 15 Feb 2023 00:26:20 +0000 (00:26 +0000)
git-svn-id: https://svn.redmine.org/redmine/branches/4.2-stable@22110 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/timelog_controller.rb
test/functional/timelog_controller_test.rb

index f70c4d410726ba5ce7b4fba945d50b2fb6329b65..ce1f01298f6be0686281ecb1cf6a7b8fd7bb3269 100644 (file)
@@ -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)
index 6b04e7d001d0436ed2494f3c544db46800c82892..451bbaa0971636426ae5507812b031d5f9c70bb5 100644 (file)
@@ -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