Skip to content

Commit

Permalink
Merge pull request #16 from plone/15.fixed
Browse files Browse the repository at this point in the history
Process the catalog queue before looking up in the catalog
  • Loading branch information
mauritsvanrees authored Oct 10, 2022
2 parents 18c9550 + 983c445 commit 2194e99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions news/15.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Process the catalog queue before looking up in the catalog
[ale-rt]
4 changes: 4 additions & 0 deletions plone/app/uuid/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from AccessControl import Unauthorized
from Products.CMFCore.indexing import processQueue
from Products.CMFCore.utils import getToolByName
from Products.ZCatalog.query import IndexQuery
from zope.component.hooks import getSite
Expand Down Expand Up @@ -40,6 +41,9 @@ def uuidToPhysicalPath(uuid):
if catalog is None:
return
index = catalog.Indexes["UID"]

# Process the catalog queue in case we have pending relevant operations
processQueue()
try:
# This uses a private attribute, so be careful.
rid = index._index.get(uuid)
Expand Down

0 comments on commit 2194e99

Please sign in to comment.