-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Florent Guillaume wrote:
> 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.
> 

Yes indeed.  I would have noticed except that the unit test was
asserting the wrong state for the hooks after removal.


Fixed in revision 41522:

  http://svn.zope.org/CMF/?rev=41522&view=rev

Thanks for the catch!


Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD3/30+gerLs4ltQ4RAss4AJ9GxgkgmmOixHMm+Eyt9fk0jLt7HACdH4Jw
4/5GxfRlPMiUwTshkyDaHOU=
=CL/g
-----END PGP SIGNATURE-----
_______________________________________________
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