]> source.dussan.org Git - redmine.git/commitdiff
Fixed: issue filters may be lost when paginating after r1026.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 15 Jan 2008 18:18:49 +0000 (18:18 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 15 Jan 2008 18:18:49 +0000 (18:18 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1065 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index b34b5b502242b3aec3937da898706defe5cc8b77..111709ce4ce92c768214ea42c130a502f4315df6 100644 (file)
@@ -114,6 +114,8 @@ module ApplicationHelper
   def pagination_links_full(paginator, count=nil, options={})
     page_param = options.delete(:page_param) || :page
     url_param = params.dup
+    # don't reuse params if filters are present
+    url_param.clear if url_param.has_key?(:set_filter)
     
     html = ''    
     html << link_to_remote(('&#171; ' + l(:label_previous)), 
@@ -138,9 +140,12 @@ module ApplicationHelper
   end
   
   def per_page_links(selected=nil)
+    url_param = params.dup
+    url_param.clear if url_param.has_key?(:set_filter)
+    
     links = Setting.per_page_options_array.collect do |n|
       n == selected ? n : link_to_remote(n, {:update => "content", :url => params.dup.merge(:per_page => n)}, 
-                                            {:href => url_for(params.dup.merge(:per_page => n))})
+                                            {:href => url_for(url_param.merge(:per_page => n))})
     end
     links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil
   end