From 90870af5ac0659415594e80969958083a3c57a7f Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Wed, 19 Mar 2014 19:33:49 +0000 Subject: [PATCH] Fix: fnServerData compatiblity for 1.9- - fnServerData's second parameter should be an array of objects with name/value pairs. It was being passed through as the more modern object, but fnServerData is only present for compatiblity with 1.9 and should the original format should be retained. This is done with a simple map function --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index 9df70318..891685ff 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -0bc427ba863a2bd355b59629bd82281cc81e4d28 +fb8a718af86bdcb880606e67c30bd118e3efd174 diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 5b064708..2d35f724 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -2306,7 +2306,12 @@ { // DataTables 1.9- compatibility oSettings.fnServerData.call( instance, - oSettings.sAjaxSource, data, fn, oSettings + oSettings.sAjaxSource, + $.map( data, function (val, key) { // Need to convert back to 1.9 trad format + return { name: key, value: val }; + } ), + fn, + oSettings ); } else if ( oSettings.sAjaxSource || typeof ajax === 'string' )