Commit d1c02864 authored by Julien Muchembled's avatar Julien Muchembled

Fix retrieval of catalog tool for unwrapped objects

This reverts 39157 & 39184 partially.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39215 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0a89e89e
......@@ -360,8 +360,11 @@ class CopyContainer:
Unindex the object from the portal catalog.
"""
if self.isIndexable:
catalog = getattr(self.getPortalObject(), 'portal_catalog', None)
if catalog is not None:
try:
catalog = self.getPortalObject().portal_catalog
except AttributeError:
pass
else:
# Make sure there is not activity for this object
self.flushActivity(invoke=0)
uid = getattr(self,'uid',None)
......
......@@ -16,6 +16,7 @@
from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
from Acquisition import aq_base
from Products.CMFCore.utils import getToolByName
def reindexObject(self, idxs=[], *args, **kw):
"""
......@@ -30,7 +31,7 @@ def reindexObject(self, idxs=[], *args, **kw):
# Update the modification date.
if getattr(aq_base(self), 'notifyModified', None) is not None:
self.notifyModified()
catalog = getattr(self.getPortalObject(), 'portal_catalog', None)
catalog = getToolByName(self, 'portal_catalog', None)
if catalog is not None:
catalog.reindexObject(self, idxs=idxs, *args, **kw)
......
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