From 7c1d27ae5fe7ab128b0eb783705a938afebdcd6a Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Mon, 23 Sep 2013 11:45:14 +0100 Subject: [PATCH] Dev fix: HTML-5 attr detection could provide undefined functions - The HTML5 attribute detection for sorting, filtering etc was breaking if you didn't provide a filtering _and_ sorting attributes since they created an undefined get data function, which causes DataTables to complain. Fix is to just check for a null value. --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index 98dc2569..bbead808 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -2fc7d68b67ae47fd952c4409f1c1a6227e2bb648 +2710768e040c77ffa125c63d4951de6620686cc0 diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 5519e6b4..024b0c02 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -795,7 +795,9 @@ /* Build an object of get functions, and wrap them in a single call */ var o = {}; $.each( mSource, function (key, val) { - o[key] = _fnGetObjectDataFn( val ); + if ( val ) { + o[key] = _fnGetObjectDataFn( val ); + } } ); return function (data, type, extra) {