[javascript] add safety belt in cubicwebSortValueExtraction for cases where cubicweb:sortvalue is not available
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Fri, 09 Jan 2009 11:01:34 +0100
changeset 379 3c19343f2848
parent 378 c0cd7398edff
child 380 06e7f2932afe
[javascript] add safety belt in cubicwebSortValueExtraction for cases where cubicweb:sortvalue is not available
web/data/jquery.tablesorter.js
--- a/web/data/jquery.tablesorter.js	Fri Jan 09 09:18:16 2009 +0100
+++ b/web/data/jquery.tablesorter.js	Fri Jan 09 11:01:34 2009 +0100
@@ -864,7 +864,11 @@
 
 
 function cubicwebSortValueExtraction(node){
-    return jQuery(node).attr('cubicweb:sortvalue');
+    var sortvalue = jQuery(node).attr('cubicweb:sortvalue');
+    if (sortvalue === undefined) {
+	return '';
+    }
+    return sortvalue;
 }
 
 Sortable.sortTables = function() {