From a98aa005a88121eb5e99cf03bbd723fbd4e28912 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 19 Dec 2014 10:28:47 +0100 Subject: [PATCH] Bug 13476: Fix DataTables for the search items form MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This items form is broken since the upgrade to DataTables 1.10.2 (commit 954c2874d0d9ebfa2e910dcd4445010115fac329). The fnServerParams does not work anymore. Test plan: Go on catalogue/itemsearch.pl, launch a search and verify the data are correctly displayed in the table. Followed test plan. Works as expected. Signed-off-by: Marc Véron Signed-off-by: Mirko Tietgen Signed-off-by: Katrin Fischer The paging seems still a bit buggy, but this makes the feature usable again! Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 6114c5fd6fe735f332e1615b33bf62de0f4d936e) Signed-off-by: Chris Cormack --- .../prog/en/modules/catalogue/itemsearch.tt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index 0c65c11323..a8a7030e39 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -215,11 +215,20 @@ 'bServerSide': true, 'bProcessing': true, 'sAjaxSource': '/cgi-bin/koha/catalogue/itemsearch.pl', - 'fnServerParams': function(aoData) { + 'fnServerData': function(sSource, aoData, fnCallback) { aoData.push( { 'name': 'format', 'value': 'json' } ); for (i in params) { aoData.push(params[i]); } + $.ajax({ + 'dataType': 'json', + 'type': 'POST', + 'url': sSource, + 'data': aoData, + 'success': function(json){ + fnCallback(json); + } + }); }, 'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', 'aoColumns': [ -- 2.39.5