]> source.dussan.org Git - redmine.git/commitdiff
Don't generate pagination links with params.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 10 Jul 2016 16:47:49 +0000 (16:47 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 10 Jul 2016 16:47:49 +0000 (16:47 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@15627 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/pagination.rb
test/integration/issues_test.rb

index a28236a2865d91556e902f9719072a054cb10934..0457a4b68ead677986508ba5629428208cb5c89c 100644 (file)
@@ -145,7 +145,7 @@ module Redmine
           if block_given?
             yield text, parameters, options
           else
-            link_to text, params.merge(parameters), options
+            link_to text, {:params => request.query_parameters.merge(parameters)}, options
           end
         end
       end
index fb80002049803234fa312fd15f7033cf68cbb8d9..5d94a57bcb909a8725ba361b84bc1addb980d62f 100644 (file)
@@ -135,11 +135,11 @@ class IssuesTest < Redmine::IntegrationTest
     end
   end
 
-  def test_pagination_links_on_index_without_project_id_in_url
+  def test_pagination_links_should_preserve_query_parameters
     with_settings :per_page_options => '2' do
-      get '/issues', :project_id => 'ecookbook'
-  
-      assert_select 'a[href=?]', '/projects/ecookbook/issues?page=2', :text => '2'
+      get '/projects/ecookbook/issues?foo=bar'
+
+      assert_select 'a[href=?]', '/projects/ecookbook/issues?foo=bar&page=2', :text => '2'
     end
   end