From 9d396e43f10a80466995f45b2b96e64841286276 Mon Sep 17 00:00:00 2001 From: Hanno Schlichting Date: Fri, 25 Jun 2010 17:16:15 +0000 Subject: [PATCH] Protect against missing canonical in conversationCanonicalAdapterFactory. svn path=/plone.app.discussion/trunk/; revision=37410 --- CHANGES.txt | 3 +++ plone/app/discussion/conversation.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index f301590..fc79c63 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,9 @@ Changelog 1.0b5 (unreleased) ------------------ +* Protect against missing canonical in conversationCanonicalAdapterFactory. + [hannosch] + * Documentation for Captcha plugin architecture and email notification added. See http://packages.python.org/plone.app.discussion. [timo] diff --git a/plone/app/discussion/conversation.py b/plone/app/discussion/conversation.py index f3bb627..80419ec 100644 --- a/plone/app/discussion/conversation.py +++ b/plone/app/discussion/conversation.py @@ -373,7 +373,9 @@ else: so that comments will be shared across all translations. """ if ITranslatable.providedBy(content): - content = content.getCanonical() + canonical = content.getCanonical() + if canonical is not None: + return conversationAdapterFactory(canonical) return conversationAdapterFactory(content)