Skip to content

Commit

Permalink
Process the catalog queue before looking up in the catalog
Browse files Browse the repository at this point in the history
Fixes #15
  • Loading branch information
ale-rt committed Oct 7, 2022
1 parent 18c9550 commit 983c445
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
@@ -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
@@ -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 983c445

Please sign in to comment.