Commit 44d8608e authored by Stefan H. Holek's avatar Stefan H. Holek

Collector #2307: ObjectCopiedEvent not dispatched to sublocations.

parent 2ed7d239
...@@ -8,6 +8,8 @@ Zope Changes ...@@ -8,6 +8,8 @@ Zope Changes
Bugs fixed Bugs fixed
- Collector #2307: ObjectCopiedEvent not dispatched to sublocations.
- Fixed ZClass test breakage due to non-pickleability of - Fixed ZClass test breakage due to non-pickleability of
'zope.interface.Implements' 'zope.interface.Implements'
......
...@@ -125,6 +125,13 @@ def dispatchObjectClonedEvent(ob, event): ...@@ -125,6 +125,13 @@ def dispatchObjectClonedEvent(ob, event):
if OFS.interfaces.IObjectManager.providedBy(ob): if OFS.interfaces.IObjectManager.providedBy(ob):
dispatchToSublocations(ob, event) dispatchToSublocations(ob, event)
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): def callManageAfterAdd(ob, item, container):
"""Compatibility subscriber for manage_afterAdd. """Compatibility subscriber for manage_afterAdd.
......
...@@ -224,7 +224,7 @@ class TestCopySupportSublocation(EventTest): ...@@ -224,7 +224,7 @@ class TestCopySupportSublocation(EventTest):
self.subfolder.manage_clone(self.folder.myfolder, 'myfolder') self.subfolder.manage_clone(self.folder.myfolder, 'myfolder')
self.assertEqual(eventlog.called(), self.assertEqual(eventlog.called(),
[('myfolder', 'ObjectCopiedEvent'), [('myfolder', 'ObjectCopiedEvent'),
#('mydoc', 'ObjectCopiedEvent'), ('mydoc', 'ObjectCopiedEvent'),
('myfolder', 'ObjectWillBeAddedEvent'), ('myfolder', 'ObjectWillBeAddedEvent'),
('mydoc', 'ObjectWillBeAddedEvent'), ('mydoc', 'ObjectWillBeAddedEvent'),
('myfolder', 'ObjectAddedEvent'), ('myfolder', 'ObjectAddedEvent'),
...@@ -240,7 +240,7 @@ class TestCopySupportSublocation(EventTest): ...@@ -240,7 +240,7 @@ class TestCopySupportSublocation(EventTest):
self.subfolder.manage_pasteObjects(cb) self.subfolder.manage_pasteObjects(cb)
self.assertEqual(eventlog.called(), self.assertEqual(eventlog.called(),
[('myfolder', 'ObjectCopiedEvent'), [('myfolder', 'ObjectCopiedEvent'),
#('mydoc', 'ObjectCopiedEvent'), ('mydoc', 'ObjectCopiedEvent'),
('myfolder', 'ObjectWillBeAddedEvent'), ('myfolder', 'ObjectWillBeAddedEvent'),
('mydoc', 'ObjectWillBeAddedEvent'), ('mydoc', 'ObjectWillBeAddedEvent'),
('myfolder', 'ObjectAddedEvent'), ('myfolder', 'ObjectAddedEvent'),
...@@ -282,7 +282,7 @@ class TestCopySupportSublocation(EventTest): ...@@ -282,7 +282,7 @@ class TestCopySupportSublocation(EventTest):
self.folder.myfolder.COPY(req, req.RESPONSE) self.folder.myfolder.COPY(req, req.RESPONSE)
self.assertEqual(eventlog.called(), self.assertEqual(eventlog.called(),
[('myfolder', 'ObjectCopiedEvent'), [('myfolder', 'ObjectCopiedEvent'),
#('mydoc', 'ObjectCopiedEvent'), ('mydoc', 'ObjectCopiedEvent'),
('myfolder', 'ObjectWillBeAddedEvent'), ('myfolder', 'ObjectWillBeAddedEvent'),
('mydoc', 'ObjectWillBeAddedEvent'), ('mydoc', 'ObjectWillBeAddedEvent'),
('myfolder', 'ObjectAddedEvent'), ('myfolder', 'ObjectAddedEvent'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment