0010588: Folder structure is displayed incorrectly
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 28 May 2015 14:18:14 +0000 (16:18 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 28 May 2015 14:30:56 +0000 (16:30 +0200)
* totalcount can be 0 .... implements a better way for checking search response structure

https://forge.tine20.org/view.php?id=10588

Change-Id: I7d4f2102cda263751150af3e1df1aece06fa0efd
Reviewed-on: http://gerrit.tine20.com/customers/1958
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/js/widgets/tree/Loader.js

index ee0839c..300e461 100644 (file)
@@ -72,7 +72,7 @@ Tine.widgets.tree.Loader = Ext.extend(Ext.tree.TreeLoader, {
     processResponse: function(response, node, callback, scope) {
         // convert tine search response into usual treeLoader structure
         var o = response.responseData || Ext.decode(response.responseText);
-        response.responseData = o.totalcount ? o.results : o;
+        response.responseData = o.hasOwnProperty('totalcount') ? o.results : o;
         
         // processed nodes / structures
         var newResponse = [];