Log message for revision 76597:
  Collector #2307: ObjectCopiedEvent not dispatched to sublocations.
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/OFS/subscribers.py
  U   Zope/branches/2.10/lib/python/OFS/tests/testCopySupportEvents.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.10/doc/CHANGES.txt  2007-06-10 20:25:42 UTC (rev 76596)
+++ Zope/branches/2.10/doc/CHANGES.txt  2007-06-10 21:15:48 UTC (rev 76597)
@@ -8,6 +8,8 @@
 
     Bugs fixed
 
+      - Collector #2307: ObjectCopiedEvent not dispatched to sublocations.
+
       - Collector #2304: fixed markup issue in ptEdit.zpt
 
       - Collector #2260: fixed Examples.zexp

Modified: Zope/branches/2.10/lib/python/OFS/subscribers.py
===================================================================
--- Zope/branches/2.10/lib/python/OFS/subscribers.py    2007-06-10 20:25:42 UTC 
(rev 76596)
+++ Zope/branches/2.10/lib/python/OFS/subscribers.py    2007-06-10 21:15:48 UTC 
(rev 76597)
@@ -31,6 +31,7 @@
 import zope.location.interfaces
 from zope.app.container.contained import dispatchToSublocations
 from zope.app.container.interfaces import IObjectMovedEvent
+from zope.lifecycleevent.interfaces import IObjectCopiedEvent
 
 deprecatedManageAddDeleteClasses = []
 
@@ -130,7 +131,15 @@
     if OFS.interfaces.IObjectManager.providedBy(ob):
         dispatchToSublocations(ob, event)
 
[EMAIL PROTECTED](OFS.interfaces.IItem, IObjectCopiedEvent)
+def dispatchObjectCopiedEvent(ob, event):
+    """Multi-subscriber for IItem + IObjectCopiedEvent.
+    """
+    # Dispatch to sublocations
+    if OFS.interfaces.IObjectManager.providedBy(ob):
+        dispatchToSublocations(ob, event)
 
+
 def callManageAfterAdd(ob, item, container):
     """Compatibility subscriber for manage_afterAdd.
     """

Modified: Zope/branches/2.10/lib/python/OFS/tests/testCopySupportEvents.py
===================================================================
--- Zope/branches/2.10/lib/python/OFS/tests/testCopySupportEvents.py    
2007-06-10 20:25:42 UTC (rev 76596)
+++ Zope/branches/2.10/lib/python/OFS/tests/testCopySupportEvents.py    
2007-06-10 21:15:48 UTC (rev 76597)
@@ -224,7 +224,7 @@
         self.subfolder.manage_clone(self.folder.myfolder, 'myfolder')
         self.assertEqual(eventlog.called(),
             [('myfolder', 'ObjectCopiedEvent'),
-             #('mydoc', 'ObjectCopiedEvent'),
+             ('mydoc', 'ObjectCopiedEvent'),
              ('myfolder', 'ObjectWillBeAddedEvent'),
              ('mydoc', 'ObjectWillBeAddedEvent'),
              ('myfolder', 'ObjectAddedEvent'),
@@ -240,7 +240,7 @@
         self.subfolder.manage_pasteObjects(cb)
         self.assertEqual(eventlog.called(),
             [('myfolder', 'ObjectCopiedEvent'),
-             #('mydoc', 'ObjectCopiedEvent'),
+             ('mydoc', 'ObjectCopiedEvent'),
              ('myfolder', 'ObjectWillBeAddedEvent'),
              ('mydoc', 'ObjectWillBeAddedEvent'),
              ('myfolder', 'ObjectAddedEvent'),
@@ -282,7 +282,7 @@
         self.folder.myfolder.COPY(req, req.RESPONSE)
         self.assertEqual(eventlog.called(),
             [('myfolder', 'ObjectCopiedEvent'),
-             #('mydoc', 'ObjectCopiedEvent'),
+             ('mydoc', 'ObjectCopiedEvent'),
              ('myfolder', 'ObjectWillBeAddedEvent'),
              ('mydoc', 'ObjectWillBeAddedEvent'),
              ('myfolder', 'ObjectAddedEvent'),

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to