Skip to content

Commit

Permalink
Comment out portal_catalog.undoable_transactions() usage date from th…
Browse files Browse the repository at this point in the history
…e cache_key. This method is not compatible with Plone 5.2/Zope 4.0.
  • Loading branch information
instification committed Sep 5, 2019
1 parent 59c89fe commit 0df5416
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/collective/collectionfilter/vocabularies.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@
# than changes to cataloged items).
def _groupby_cache_key(method, self):
portal = plone.api.portal.get()
cat = plone.api.portal.get_tool('portal_catalog')
site_path = '/'.join(portal.getPhysicalPath())
cat_changed = cat.undoable_transactions()[:1]
cat_changed = len(cat_changed) > 0 and cat_changed[0]['time'] or ''
cache_key = site_path + str(cat_changed)
cache_key = site_path
# TODO: clear cache if portal_catalog is modified
# cat = portal.portal_catalog
# cat_changed = cat.undoable_transactions()[:1]
# cat_changed = len(cat_changed) > 0 and cat_changed[0]['time'] or ''
# cache_key = site_path + str(cat_changed)
return cache_key


Expand Down

0 comments on commit 0df5416

Please sign in to comment.