I am migrating an AT package to Dexterity where we need to assign a marker interface to new folders.
All folders created with id img
should provide IImageLibrary
. The former AT implementation used a content rule for event="Products.Archetypes.interfaces.IObjectInitializedEvent"
.
I tried to use event=zope.lifecycleevent.IObjectCreatedEvent
but this preaks the Plone content rules control panel because this event is not registered with the related vocabulary in Plone:
Module snoop.tracer, line 169, in simple_wrapper
Module plone.app.contentrules.browser.controlpanel, line 81, in registeredRules
KeyError: <InterfaceClass zope.lifecycleevent.interfaces.IObjectCreatedEvent>
A registration with event=zope.lifecycleevent.IObjectModifiedEvent
works for edit operations but not during the inital edit operation.
So what's the best way to hook into the object creation process - with or without content rules?