diff --git a/CHANGES.rst b/CHANGES.rst index c2ace1b..36e21c8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -93,6 +93,8 @@ Changelog to old discussion items that had none. [pjstevns] +- Fix reindexObject for content_object in moderation views. + Now reindex only "total_comments" index and not all the indexes [cekk] 2.2.6 (2013-05-23) ------------------ diff --git a/plone/app/discussion/browser/moderation.py b/plone/app/discussion/browser/moderation.py index da710b1..55110e8 100644 --- a/plone/app/discussion/browser/moderation.py +++ b/plone/app/discussion/browser/moderation.py @@ -95,7 +95,7 @@ class DeleteComment(BrowserView): conversation = aq_parent(comment) content_object = aq_parent(conversation) del conversation[comment.id] - content_object.reindexObject() + content_object.reindexObject(idxs=['total_comments']) IStatusMessage(self.context.REQUEST).addStatusMessage( _("Comment deleted."), type="info") @@ -134,7 +134,7 @@ class PublishComment(BrowserView): workflow_action = self.request.form.get('workflow_action', 'publish') workflowTool.doActionFor(comment, workflow_action) comment.reindexObject() - content_object.reindexObject() + content_object.reindexObject(idxs=['total_comments']) IStatusMessage(self.context.REQUEST).addStatusMessage( _("Comment approved."), type="info") @@ -207,7 +207,7 @@ class BulkActionsView(BrowserView): if current_state != 'published': workflowTool.doActionFor(comment, 'publish') comment.reindexObject() - content_object.reindexObject() + content_object.reindexObject(idxs=['total_comments']) def mark_as_spam(self): raise NotImplementedError @@ -226,4 +226,4 @@ class BulkActionsView(BrowserView): conversation = aq_parent(comment) content_object = aq_parent(conversation) del conversation[comment.id] - content_object.reindexObject() + content_object.reindexObject(idxs=['total_comments'])