Commit f3a1870a authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

SQLCatalog: Use isIndexingRequired as ERP5Site object has no longer isIndexable attribute

parent 867662e8
...@@ -5364,7 +5364,7 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -5364,7 +5364,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
if update_catalog: if update_catalog:
catalog = _getCatalogValue(self) catalog = _getCatalogValue(self)
if (catalog is None) or (not site.isIndexable): if (catalog is None) or (not site.isIndexingRequired()):
LOG('Business Template', 0, 'no SQL Catalog available') LOG('Business Template', 0, 'no SQL Catalog available')
update_catalog = 0 update_catalog = 0
else: else:
......
...@@ -237,7 +237,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin): ...@@ -237,7 +237,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
last_id = 0 last_id = 0
icon = 'portal.gif' icon = 'portal.gif'
# Default value, prevents error during upgrade # Default value, prevents error during upgrade
isIndexable = ConstantGetter('isIndexable', value=True) isIndexingRequired = ConstantGetter('isIndexingRequired', value=True)
# There can remain a lot a activities to be processed once all BT5 are # There can remain a lot a activities to be processed once all BT5 are
# installed, and scalability tests want a reliable way to know when the site # installed, and scalability tests want a reliable way to know when the site
# is ready to be tortured. # is ready to be tortured.
...@@ -1893,7 +1893,7 @@ class ERP5Generator(PortalGenerator): ...@@ -1893,7 +1893,7 @@ class ERP5Generator(PortalGenerator):
portal = self.klass(id=id) portal = self.klass(id=id)
# Make sure reindex will not be called until business templates # Make sure reindex will not be called until business templates
# will be installed # will be installed
setattr(portal, 'isIndexable', ConstantGetter('isIndexable', value=False)) setattr(portal, 'isIndexingRequired', ConstantGetter('isIndexingRequired', value=False))
# This is only used to refine log level. # This is only used to refine log level.
# Has no functional use, and should never have any: # Has no functional use, and should never have any:
...@@ -2206,7 +2206,7 @@ class ERP5Generator(PortalGenerator): ...@@ -2206,7 +2206,7 @@ class ERP5Generator(PortalGenerator):
def setupIndex(self, p, **kw): def setupIndex(self, p, **kw):
# Make sure all tools and folders have been indexed # Make sure all tools and folders have been indexed
if kw.get('reindex', 1): if kw.get('reindex', 1):
setattr(p, 'isIndexable', ConstantGetter('isIndexable', value=True)) setattr(p, 'isIndexingRequired', ConstantGetter('isIndexingRequired', value=True))
# Clear portal ids sql table, like this we do not take # Clear portal ids sql table, like this we do not take
# ids for a previously created web site # ids for a previously created web site
p.portal_ids.clearGenerator(all=True) p.portal_ids.clearGenerator(all=True)
......
...@@ -1100,8 +1100,8 @@ class Catalog(Folder, ...@@ -1100,8 +1100,8 @@ class Catalog(Folder,
), ),
) )
security.declarePrivate('isIndexable') security.declarePrivate('isIndexingRequired')
def isIndexable(self): def isIndexingRequired(self):
""" """
This is required to check in many methods that This is required to check in many methods that
the site root and zope root are indexable the site root and zope root are indexable
...@@ -1109,8 +1109,8 @@ class Catalog(Folder, ...@@ -1109,8 +1109,8 @@ class Catalog(Folder,
zope_root = self.getZopeRoot() zope_root = self.getZopeRoot()
site_root = self.getSiteRoot() # XXX-JPS - Why don't we use getPortalObject here ? site_root = self.getSiteRoot() # XXX-JPS - Why don't we use getPortalObject here ?
root_indexable = int(getattr(zope_root, 'isIndexable', 1)) root_indexable = int(getattr(zope_root, 'isIndexingRequired', 1))
site_indexable = int(getattr(site_root, 'isIndexable', 1)) site_indexable = int(getattr(site_root, 'isIndexingRequired', 1))
if not (root_indexable and site_indexable): if not (root_indexable and site_indexable):
return False return False
return True return True
...@@ -1157,7 +1157,7 @@ class Catalog(Folder, ...@@ -1157,7 +1157,7 @@ class Catalog(Folder,
Similar problems may happen with relations and acquisition of uid values (ex. order_uid) Similar problems may happen with relations and acquisition of uid values (ex. order_uid)
with the risk of graph loops with the risk of graph loops
""" """
if not self.getPortalObject().isIndexable(): if not self.getPortalObject().isIndexingRequired():
return None return None
with global_reserved_uid_lock: with global_reserved_uid_lock:
...@@ -1322,7 +1322,8 @@ class Catalog(Folder, ...@@ -1322,7 +1322,8 @@ class Catalog(Folder,
if idxs not in (None, []): if idxs not in (None, []):
LOG('ZSLQCatalog.SQLCatalog:catalogObjectList', WARNING, LOG('ZSLQCatalog.SQLCatalog:catalogObjectList', WARNING,
'idxs is ignored in this function and is only provided to be compatible with CMFCatalogAware.reindexObject.') 'idxs is ignored in this function and is only provided to be compatible with CMFCatalogAware.reindexObject.')
if not self.getPortalObject().isIndexable():
if not self.getPortalObject().isIndexingRequired():
return return
object_path_dict = {} object_path_dict = {}
...@@ -1507,7 +1508,7 @@ class Catalog(Folder, ...@@ -1507,7 +1508,7 @@ class Catalog(Folder,
""" """
Set the path as deleted Set the path as deleted
""" """
if not self.getPortalObject().isIndexable(): if not self.getPortalObject().isIndexingRequired():
return None return None
if uid is None and path is not None: if uid is None and path is not None:
...@@ -1540,7 +1541,7 @@ class Catalog(Folder, ...@@ -1540,7 +1541,7 @@ class Catalog(Folder,
XXX Add filter of methods XXX Add filter of methods
""" """
if not self.getPortalObject().isIndexable(): if not self.getPortalObject().isIndexingRequired():
return None return None
if uid is None and path is not None: if uid is None and path is not None:
......
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