From f217a4293233e5df659f6b5137b274ebeb450afa Mon Sep 17 00:00:00 2001 From: Gil Forcada Date: Thu, 21 Mar 2019 08:57:08 +0100 Subject: [PATCH 1/2] index/reindex/unindex the object itself Do not defer to p.a.discussion own tool. That's needed so that collective.indexing can patch comments, so in turn can be indexed by Solr. --- plone/app/discussion/subscribers.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plone/app/discussion/subscribers.py b/plone/app/discussion/subscribers.py index c3717e5..0234c97 100644 --- a/plone/app/discussion/subscribers.py +++ b/plone/app/discussion/subscribers.py @@ -5,12 +5,10 @@ from Products.CMFCore.utils import getToolByName def index_object(obj, event): """Index the object when it is added/modified to the conversation. """ - catalog = getToolByName(obj, 'portal_catalog') - return catalog.reindexObject(obj) + obj.indexObject() def unindex_object(obj, event): """Unindex the object when it is removed from the conversation. """ - catalog = getToolByName(obj, 'portal_catalog') - return catalog.unindexObject(obj) + obj.unindexObject() From 8cb659c82880ec561f2ba4ffca27c9bb13ae6650 Mon Sep 17 00:00:00 2001 From: Gil Forcada Date: Thu, 21 Mar 2019 08:17:25 +0100 Subject: [PATCH 2/2] Add news entry --- news/77.feature | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 news/77.feature diff --git a/news/77.feature b/news/77.feature new file mode 100644 index 0000000..b03dc48 --- /dev/null +++ b/news/77.feature @@ -0,0 +1,3 @@ +Index/reindex/unindex the comment itself, do not defer to ``ICommentingTool``. +This way it can be integrated into collective.indexing and Solr (or any other indexing tool). +[gforcada]