From ec76873e950651fc4909628d92ecc801b05fcc17 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Thu, 13 Jul 2017 11:41:19 +0200 Subject: [PATCH] fix sorting by assigned causes ajax error --- app/datatables/repository_datatable.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/datatables/repository_datatable.rb b/app/datatables/repository_datatable.rb index bdc46480f..710ba08cf 100644 --- a/app/datatables/repository_datatable.rb +++ b/app/datatables/repository_datatable.rb @@ -234,6 +234,8 @@ class RepositoryDatatable < AjaxDatatablesRails::Base def sort_records(records) if params[:order].present? && params[:order].length == 1 if sort_column(params[:order].values[0]) == ASSIGNED_SORT_COL + # If "assigned" column is sorted when viewing assigned items + return records if @my_module && params[:assigned] == 'assigned' # If "assigned" column is sorted direction = sort_null_direction(params[:order].values[0]) if @my_module