diff --git a/CHANGES.rst b/CHANGES.rst index 8995205..c2ace1b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,9 @@ Changelog 2.3.2 (unreleased) ------------------ +- Fix comments Title if utf-8 characters in author_name + [huub_bouma] + - use member.getId as author_username, so membrane users having different id then username still have there picture shown and author path is correct. [maartenkling] @@ -42,7 +45,8 @@ Changelog PLONE_FIXTURE. [timo] -- Fix ownership of comments. [toutpt] +- Fix ownership of comments. + [toutpt] 2.2.10 (2013-09-24) diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index df81bf7..6bcfdcf 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -186,7 +186,7 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable, content = aq_base(self.__parent__.__parent__) title = translate( Message(COMMENT_TITLE, - mapping={'author_name': author_name, + mapping={'author_name': safe_unicode(author_name), 'content': safe_unicode(content.Title())})) return title diff --git a/plone/app/discussion/tests/test_comment.py b/plone/app/discussion/tests/test_comment.py index d5df9c2..4a281dd 100644 --- a/plone/app/discussion/tests/test_comment.py +++ b/plone/app/discussion/tests/test_comment.py @@ -125,6 +125,18 @@ class CommentTest(unittest.TestCase): conversation.addComment(comment1) self.assertEqual(u"Tarek Ziadé on Document äüö", comment1.Title()) + def test_title_special_characters_utf8(self): + self.portal.invokeFactory( + id='doc_sp_chars_utf8', + title='Document ëïû', + type_name='Document' + ) + conversation = IConversation(self.portal.doc_sp_chars_utf8) + comment1 = createObject('plone.Comment') + comment1.author_name = "Hüüb Bôûmä" + conversation.addComment(comment1) + self.assertEqual(u"Hüüb Bôûmä on Document ëïû", comment1.Title()) + def test_creator(self): comment1 = createObject('plone.Comment') comment1.creator = "jim"