From fa681a34b87165cea7dd55ed7a1b12870d43bfa0 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Thu, 13 May 2004 16:49:24 +0000
Subject: [PATCH] check if the portal is indexable, true by default

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@875 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ZSQLCatalog/SQLCatalog.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/product/ZSQLCatalog/SQLCatalog.py b/product/ZSQLCatalog/SQLCatalog.py
index c9cef051ff..c039b09343 100755
--- a/product/ZSQLCatalog/SQLCatalog.py
+++ b/product/ZSQLCatalog/SQLCatalog.py
@@ -162,6 +162,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
 
     """
     LOG('Catalog object:',0,str(path))
+    parent = object.aq_parent
 
     # Prepare the dictionnary of values
     kw = {}
@@ -301,7 +302,9 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
         # Alter row
         # Create row
         #try:
-        if 1:
+        zope_root = self.getPortalObject().aq_parent
+        root_indexable = int(getattr(zope_root,'isIndexable',1))
+        if root_indexable:
           #LOG("Call SQL Method %s with args:" % method_name,0, str(kw))
           method(**kw)
         #except:
@@ -570,7 +573,6 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
         pass
 
     # Return the result
-    #LOG('queryResults',0,'kw: %s' % str(kw))
     return sql_method(**kw)
 
   def searchResults(self, REQUEST=None, used=None, **kw):
-- 
2.30.9