uncatalog comments from the old location of the item being moved, not its parent

svn path=/plone.app.discussion/trunk/; revision=51692
This commit is contained in:
David Glick 2011-08-20 02:37:24 +00:00
parent 2b10fd06e2
commit 2bf5b43df5
2 changed files with 3 additions and 2 deletions

View File

@ -16,7 +16,7 @@ Changelog
- Make sure only comments to the content object are removed from the catalog
when the content object is moved.
[hannosch, timo]
[hannosch, timo, davisagli]
- Make sure the conversation.getComments method returns acquisition wrapped
comments.

View File

@ -227,8 +227,9 @@ def notify_content_object_moved(obj, event):
return
# Remove comments at the old location from catalog
catalog = getToolByName(obj, 'portal_catalog')
old_path = '/'.join(event.oldParent.getPhysicalPath() + (event.oldName,))
brains = catalog.searchResults(dict(
path={'query': '/'.join(event.oldParent.getPhysicalPath())},
path={'query': old_path},
portal_type="Discussion Item"
))
for brain in brains: