Commit 52f7da9d authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Rename reindexObject and getUrl methods 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 getUrl and reindexObject from the Base and the one
  from the BaseTool.

- Update CMFCatalogAware patch to handle case for catalog tool for 2 different meta_types
parent f5a721cd
......@@ -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,10 @@ 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 :
if catalog.meta_type == 'Catalog Tool':
catalog.reindexCatalogObject(self, idxs=idxs, *args, **kw)
elif catalog.meta_type == 'ERP5 Catalog':
catalog.reindexObject(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