Tres Seaver wrote:
Log message for revision 41514:
@@ -395,7 +383,24 @@
Globals.InitializeClass(CookieCrumbler) +def handleCookieCrumblerEvent(ob, event):
+    """ Event subscriber for (un)registering a CC as a before traverse hook.
+    """
+    if not ICookieCrumbler.providedBy(ob):
+        return
+ if IObjectMovedEvent.providedBy(event):
+        if event.newParent is not None:
+            # register before traverse hook
+            handle = ob.meta_type + '/' + ob.getId()
+            nc = BeforeTraverse.NameCaller(ob.getId())
+            BeforeTraverse.registerBeforeTraverse(event.newParent, nc, handle)
+    elif IObjectWillBeMovedEvent.providedBy(event):
+        if event.oldParent is not None:
+            # unregister before traverse hook
+            handle = ob.meta_type + '/' + ob.getId()
+            BeforeTraverse.unregisterBeforeTraverse(event.newParent, handle)


I think you want event.oldParent here.

Florent


+
 class ResponseCleanup:
     def __init__(self, resp):
         self.resp = resp



--
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to