diff --git a/pandora/document/views.py b/pandora/document/views.py index 9916b56d..19095465 100644 --- a/pandora/document/views.py +++ b/pandora/document/views.py @@ -169,7 +169,7 @@ def findDocuments(request): Sum('size') ) response['data']['items'] = qs.count() - response['data']['size'] = r['size__sum'] + response['data']['size'] = r['size__sum'] or 0 return render_to_json_response(response) actions.register(findDocuments) diff --git a/static/js/documentsPanel.js b/static/js/documentsPanel.js index 9a44ea70..d1fe572f 100644 --- a/static/js/documentsPanel.js +++ b/static/js/documentsPanel.js @@ -405,7 +405,7 @@ pandora.ui.documentsPanel = function(options) { } function editDocuments() { - pandora.UI.set('documentSelection.', $list.options('selected')); + pandora.UI.set('documentsSelection.', $list.options('selected')); pandora.$ui.documentsDialog = pandora.ui.documentsDialog().open(); } @@ -573,7 +573,7 @@ pandora.ui.documentsPanel = function(options) { conditions: isItemView ? [{ key: 'item', value: ui.item, operator: '==' }] : [], operator: '&' }, - selected: ui.documentsSelection[isItemView ? ui.item : ''], + selected: ui.documentsSelection[isItemView ? ui.item : ''] || [], sort: ui.documentsSort.concat([ {key: 'extension', operator: '+'}, {key: 'name', operator: '+'}