Commit 0d84b2f2 authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Rename reindexObject method to use them as new methods for CatalogTool.

- This step is needed due to the use of BaseTool as Base class for CatalogTool
  due to which there were conflict between reindexObject from the Base and the one
  from the BaseTool.
parent 86894cb2
......@@ -831,6 +831,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
if idxs is None: idxs = []
url = self.__url(object)
self.catalog_object(object, url, idxs=idxs, sql_catalog_id=sql_catalog_id,**kw)
# Required for compatibilty with ERP5CatalogTool
reindexCatalogObject = reindexObject
def catalogObjectList(self, object_list, *args, **kw):
......
......@@ -18,7 +18,7 @@ from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
from Acquisition import aq_base
from Products.CMFCore.utils import getToolByName
def reindexObject(self, idxs=[], *args, **kw):
def reindexCatalogObject(self, idxs=[], *args, **kw):
"""
Reindex the object in the portal catalog.
If idxs is present, only those indexes are reindexed.
......@@ -32,7 +32,7 @@ def reindexObject(self, idxs=[], *args, **kw):
if getattr(aq_base(self), 'notifyModified', None) is not None:
self.notifyModified()
catalog = getToolByName(self, 'portal_catalog', None)
if catalog is not None:
catalog.reindexObject(self, idxs=idxs, *args, **kw)
if catalog is not None :
catalog.reindexCatalogObject(self, idxs=idxs, *args, **kw)
CMFCatalogAware.reindexObject = reindexObject
CMFCatalogAware.reindexObject = reindexCatalogObject
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment