diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 827d1dd..13f360a 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -54,6 +54,8 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable, implements(IComment) meta_type = portal_type = 'Discussion Item' + # This needs to be kept in sync with types/Discussion_Item.xml title + fti_title = 'Comment' __parent__ = None @@ -113,8 +115,7 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable, def Type(self): """The Discussion Item content type """ - ptypes = getToolByName(self, 'portal_types') - return ptypes[self.portal_type].title + return self.fti_title # CMF's event handlers assume any IDynamicType has these :( diff --git a/plone/app/discussion/tests/test_comment.py b/plone/app/discussion/tests/test_comment.py index 2759894..e096cc6 100644 --- a/plone/app/discussion/tests/test_comment.py +++ b/plone/app/discussion/tests/test_comment.py @@ -45,7 +45,7 @@ class CommentTest(PloneTestCase): def test_type(self): comment1 = createObject('plone.Comment') - self.assertEquals(comment1.Type(), 'Discussion Item') + self.assertEquals(comment1.Type(), 'Comment') def test_traversal(self): # make sure comments are traversable, have an id, absolute_url and physical path @@ -251,4 +251,4 @@ class RepliesTest(PloneTestCase): self.assertEquals('http://nohost/plone/doc1/++conversation++default/' + str(new_re_re_re_id), re_re_re_comment.absolute_url()) def test_suite(): - return unittest.defaultTestLoader.loadTestsFromName(__name__) \ No newline at end of file + return unittest.defaultTestLoader.loadTestsFromName(__name__)