[Product-Developers] Aborting deletion of objects

Johannes Schwenk johannes.schwenk at gmail.com
Fri May 15 18:49:02 UTC 2009


Am Donnerstag, 14. Mai 2009 19:29:41 schrieb Andreas Jung:
> On 14.05.09 19:24, Johannes Schwenk wrote:
> > Currently I am trying to get things working by implementing an adapter
> > for the IObjectWillBeRemovedEvent event:
>
> Zope does definitely trigger this event.
>
> > @adapter(IEntry, IObjectWillBeRemovedEvent)
> > def verifyOnDeletion(obj, event):
> > 	"""
> > 	"""
> > [...]
> > 	raise zExceptions.Redirect(obj.asolute_url())
> > [...]
> >
> > The function never gets called... Yes I registered the adapter with
> > <subscriber handler=".vocabulary.verifyOnDeletion" />. Other adapters
> > defined that way get called...
>
> No idea. This is supposed to work. Debug the code triggering the
> event (OFS module) and check for the list of registered subscriber etc...

I tested this by issuing a 

notify(ObjectWillBeRemovedEvent(obj))

My subscriber does not get called. If I notify for example with a 
ObjectEditedEvent event my registered subscriber get called...

I will try if upgrading Plone will do any good!

Thanks!

> -aj






More information about the Product-Developers mailing list