Wichert Akkerman wrote:
> On 2009-8-8 11:53, Hanno Schlichting wrote:
>> On Sat, Aug 8, 2009 at 12:14 AM, Charlie Clark<char...@begeistert.org>
>>> Is the patch for Plone or CMF?
>> It's for Plone, I guess. The "problem is solved" in Plone 4.0 itself
>> (via monkey-patching CMF).
>>> If it's for CMF then you should consider simply submitting a patch or
>>> opening a branch. But before you write any package I would like to know a
>>> little more about what exactly you want to do.
>> The problem is the entire concept of opaque items. The only places I
>> know they are still in use is the "talkback" objects as used by the
>> discussion machinery in CMF. CMFUid also claims to implement the
>> concept, but doesn't actually need any of the functionality, since it
>> has its own event subscribers to deal with things.
>> So the problem starts in
>> CMFCore.CMFCatalogAware.dispatchToOpaqueItems, with the nice line:
>> for opaque in ob.opaqueValues():
>> which in turn calls later on the opaqueItems method which contains this
>> self_base = aq_base(self)
>> for name in self_base.__dict__.keys()
>> obj = getattr(self, name)
>> if ICallableOpaqueItem.providedBy(obj):
>> items.append((obj.getId(), obj))
That's just *nuts*!
>> The whole method redispatches any IObjectEvent fired on an
>> IOpaqueItemManager to any opaque item in it. In doing so, it needs to
>> load every single entry in the objects __dict__ to see if it is an
>> It happens that the CMFCatalogAware base class is such an
>> IOpaqueItemManager, so any essentially any content object gets this
> Could it be that this considers dexterity content to be opaque items? I
> have some code where events are recursively re-dispatched by CMF and I
> suspect this is why.
I can't see how that could happen. A Dexterity content item is a CMF
content item, with the same base classes. And it certainly doesn't
(Do note that Dexterity has an event handler to do some indexing,
because in Plone 3/CMF 2.1 at least, it didn't happen automatically).
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
Zope-CMF maillist - Zope-CMF@lists.zope.org
See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests