I need to extend a Plone product (Products.Poi) with a second product. In the extension product i need to override a subscriber event of the original. I tried to subscribe in an override.zcml an event with the same name but the second event don't override the first but all two are execute.
Here http://plone.org/products/dexterity/documentation/manual/five.grok/core-components/events seem that is not possible:
Unlike adapters, you cannot override an event subscriber by using a more specific interface. Each and every applicable event subscriber will be executed when an event is fired.
Someone has a trick?
Thanks Alex
Simone Orsi gave me a solution: z3c.unconfigure.
This product permit to disable zcml configuration.
To use it, I executed this step on my extented Poi product:
<include package="z3c.unconfigure" file="meta.zcml" />
<unconfigure>
<subscriber
for="Products.Poi.interfaces.ITracker
Products.Archetypes.interfaces.IObjectEditedEvent"
handler="Products.Poi.events.update_tracker_watchers"
/>
</unconfigure>
<subscriber
for="Products.Poi.interfaces.ITracker
Products.Archetypes.interfaces.IObjectEditedEvent"
handler=".events.update_tracker_watchers"
/>
When you specified the overrides.zcml, you also need to register the zcml override in buildout? Take a look at: http://developer.plone.org/components/zcml.html?highlight=zcml#overrides It'd be something like: zcml = my.package-overrides
Additionally, you can try using the z3c.unconfigure package: http://pypi.python.org/pypi/z3c.unconfigure
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With