diff --git a/CHANGES.txt b/CHANGES.txt index a7d7c4e..b89c3a5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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. diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 81304b2..0273b6f 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -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: