summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-11 09:25:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-11 09:25:41 +0000
commitd05d559d152d20a884c1686df8fa749f96c99a7a (patch)
treea08dae03e1154388b9d46f682c49a95a4c828d32
parent3a2b6c7c9653ddbd32ea0c2434b0c9b638832b3e (diff)
downloadredmine-d05d559d152d20a884c1686df8fa749f96c99a7a.tar.gz
redmine-d05d559d152d20a884c1686df8fa749f96c99a7a.zip
Redmine loses filters after deleting a spent time (#14817).
git-svn-id: http://svn.redmine.org/redmine/trunk@16056 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/timelog_controller.rb2
-rw-r--r--test/functional/timelog_controller_test.rb9
2 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index 6c0cd3ee6..a88ede4a5 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -207,7 +207,7 @@ class TimelogController < ApplicationController
else
flash[:error] = l(:notice_unable_delete_time_entry)
end
- redirect_back_or_default project_time_entries_path(@projects.first)
+ redirect_back_or_default project_time_entries_path(@projects.first), :referer => true
}
format.api {
if destroyed
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb
index 6af830125..594fb1e19 100644
--- a/test/functional/timelog_controller_test.rb
+++ b/test/functional/timelog_controller_test.rb
@@ -651,6 +651,15 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_not_nil TimeEntry.find_by_id(1)
end
+ def test_destroy_should_redirect_to_referer
+ referer = 'http://test.host/time_entries?utf8=✓&set_filter=1&&f%5B%5D=user_id&op%5Buser_id%5D=%3D&v%5Buser_id%5D%5B%5D=me'
+ @request.env["HTTP_REFERER"] = referer
+ @request.session[:user_id] = 2
+
+ delete :destroy, :params => {:id => 1}
+ assert_redirected_to referer
+ end
+
def test_index_all_projects
get :index
assert_response :success