From 2b10fd06e2d50246f76310ee31bdf6f237df3713 Mon Sep 17 00:00:00 2001 From: David Glick Date: Fri, 19 Aug 2011 18:54:44 +0000 Subject: [PATCH] fix failing test in CMFPlone. some things are contentish but not adaptable to IConversation (such as collection criteria) svn path=/plone.app.discussion/trunk/; revision=51682 --- CHANGES.txt | 3 +++ plone/app/discussion/comment.py | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) 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):