[CMF-checkins] CVS: Products/CMFCore - CMFCatalogAware.py:1.21.2.9

Florent Guillaume fg at nuxeo.com
Fri Apr 22 14:51:02 EDT 2005


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv9874/CMFCore

Modified Files:
      Tag: CMF-1_5-branch
	CMFCatalogAware.py 
Log Message:
Use _unrestrictedGetObject when available, and LOG when the object
cannot be retrieved.


=== Products/CMFCore/CMFCatalogAware.py 1.21.2.8 => 1.21.2.9 ===
--- Products/CMFCore/CMFCatalogAware.py:1.21.2.8	Fri Apr 22 13:16:23 2005
+++ Products/CMFCore/CMFCatalogAware.py	Fri Apr 22 14:50:32 2005
@@ -15,6 +15,7 @@
 $Id$
 """
 
+from zLOG import LOG, PROBLEM
 from AccessControl import ClassSecurityInfo
 from Acquisition import aq_base
 from ExtensionClass import Base
@@ -90,9 +91,16 @@
                 # Optimization in case of an indexable container
                 if brain_path == path:
                     continue
-                ob = self.unrestrictedTraverse(brain_path, None)
+                # Get the object
+                if hasattr(aq_base(brain), '_unrestrictedGetObject'):
+                    ob = brain._unrestrictedGetObject()
+                else:
+                    # BBB older Zope
+                    ob = self.unrestrictedTraverse(brain_path, None)
                 if ob is None:
                     # Ignore old references to deleted objects.
+                    LOG('reindexObjectSecurity', PROBLEM,
+                        "Cannot get %s from catalog" % brain_path)
                     continue
                 s = getattr(ob, '_p_changed', 0)
                 catalog.reindexObject(ob, idxs=['allowedRolesAndUsers'],



More information about the CMF-checkins mailing list