diff --git a/CHANGES.txt b/CHANGES.txt index 9a5982d..a7d7c4e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,9 @@ Changelog 2.1.0 (unreleased) ------------------ +- Avoid error when moving objects that are contentish but not annotatable. + [davisagli] + - New feature: Markdown syntax added to possible comment text transforms. [timo] diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 7bf1d36..81304b2 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -234,10 +234,11 @@ def notify_content_object_moved(obj, event): for brain in brains: catalog.uncatalog_object(brain.getPath()) # Reindex comment at the new location - conversation = IConversation(obj) - for comment in conversation.getComments(): - aq_base(comment).__parent__.__parent__.__parent__ = event.newParent - catalog.reindexObject(aq_base(comment)) + conversation = IConversation(obj, None) + if conversation is not None: + for comment in conversation.getComments(): + aq_base(comment).__parent__.__parent__.__parent__ = event.newParent + catalog.reindexObject(aq_base(comment)) def notify_user(obj, event):