diff --git a/CHANGES.txt b/CHANGES.txt index c71a26f..28f6906 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,10 @@ Changelog 1.0b4 (unreleased) ------------------ +* Fix #662654: As an administrator, I can configure a Collection to show recent comments. + Comment.Type() now correctly returns the FTI title ('Comment') + [chaoflow] + * German translation updated. [juh] diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 35373e0..827d1dd 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -113,7 +113,8 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable, def Type(self): """The Discussion Item content type """ - return self.portal_type + ptypes = getToolByName(self, 'portal_types') + return ptypes[self.portal_type].title # CMF's event handlers assume any IDynamicType has these :( diff --git a/plone/app/discussion/tests/test_catalog.py b/plone/app/discussion/tests/test_catalog.py index 99a9cde..b57e9b9 100644 --- a/plone/app/discussion/tests/test_catalog.py +++ b/plone/app/discussion/tests/test_catalog.py @@ -215,7 +215,7 @@ class CommentCatalogTest(PloneTestCase): def test_type(self): self.assertEquals(self.comment_brain.portal_type, 'Discussion Item') self.assertEquals(self.comment_brain.meta_type, 'Discussion Item') - self.assertEquals(self.comment_brain.Type, 'Discussion Item') + self.assertEquals(self.comment_brain.Type, 'Comment') def test_review_state(self): self.assertEquals(self.comment_brain.review_state, 'published')