Skip to content

Commit

Permalink
Process index operations prior to a catalog search
Browse files Browse the repository at this point in the history
That's the minimal patching that collective.indexing was performing
into Products.CMFPlone.

Part of PLIP #1343.
  • Loading branch information
gforcada committed Feb 21, 2016
1 parent d6b1255 commit b7cbd99
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Products/CMFPlone/CatalogTool.py
Expand Up @@ -39,6 +39,7 @@
from zope.interface import implementer
from zope.interface import providedBy

from Products.CMFCore.indexing import processQueue

logger = logging.getLogger('Plone')

Expand Down Expand Up @@ -366,6 +367,7 @@ def _increment_counter(self):

@security.private
def getCounter(self):
processQueue()
return self._counter is not None and self._counter() or 0

@security.protected(SearchZCatalog)
Expand All @@ -379,6 +381,7 @@ def searchResults(self, REQUEST=None, **kw):
effectiveRange checking entirely even for those without portal
wide AccessInactivePortalContent permission.
"""
processQueue()
kw = kw.copy()
show_inactive = kw.get('show_inactive', False)
if isinstance(REQUEST, dict) and not show_inactive:
Expand Down

0 comments on commit b7cbd99

Please sign in to comment.