diff --git a/src/pfwbged/collection/searchview.py b/src/pfwbged/collection/searchview.py index 4549e5e..dbd291c 100644 --- a/src/pfwbged/collection/searchview.py +++ b/src/pfwbged/collection/searchview.py @@ -27,6 +27,7 @@ from plone.z3cform.layout import wrap_form import plone.app.querystring.querybuilder from plone.app.querystring.interfaces import IQuerystringRegistryReader from plone.registry.interfaces import IRegistry ++from plone.app.contentlisting.contentlisting import ContentListing from pfwbged.collection import _ @@ -389,6 +390,14 @@ class ContentListingView(BrowserView): class QueryBuilder(plone.app.querystring.querybuilder.QueryBuilder): + def _makequery(self, *args, **kwargs): + results = plone.app.querystring.querybuilder.QueryBuilder._makequery(self, *args, **kwargs) + if isinstance(results, ContentListing): + # results may have been padded with None, but ContentListing + # doesn't like that. + results._basesequence = [x for x in results._basesequence if x is not None] + return results + def html_results(self, query): """html results, used for in the edit screen of a collection, used in the live update results"""