3618: correctly propagate the ordering parameters when scrolling
authorPhil Hodgson <bitbucket@philhodgson.net>
Sat, 25 Oct 2014 18:56:23 +0000 (20:56 +0200)
committerPhil Hodgson <bitbucket@philhodgson.net>
Sat, 25 Oct 2014 18:56:23 +0000 (20:56 +0200)
apps/workbench/app/controllers/application_controller.rb
apps/workbench/app/controllers/projects_controller.rb

index 1b87ceaa42261fe236018ed8b0f2406c451caedc..3d82b23ba5b17a65a189d3ee9c577043b94caff9 100644 (file)
@@ -119,7 +119,11 @@ class ApplicationController < ActionController::Base
     if params[:order].blank?
       @order = 'created_at desc'
     elsif !params[:order].is_a? Array
-      @order = params[:order].split(',')
+      begin
+        @order = JSON.load(params[:order])
+      rescue
+        @order = params[:order].split(',')
+      end
     end
     @order = [@order] unless @order.is_a? Array
 
index b77a48973f5a32f3a33685e6d0dc749f3c6c5027..83d2cd828be09511b3d8dd4e4b1dfd1a7029c950 100644 (file)
@@ -220,7 +220,9 @@ class ProjectsController < ApplicationController
                                   include_linked: true,
                                   filters: @filters,
                                   offset: @offset)
-      @next_page_href = next_page_href(partial: :contents_rows)
+      @next_page_href = next_page_href(partial: :contents_rows,
+                                       filters: @filters.to_json,
+                                       order: @order.to_json)
     end
 
     preload_links_for_objects(@objects.to_a)