From 1455f688fc83c933cdf73b15a2011f45e92a222c Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Thu, 26 Aug 2004 15:28:10 +0000
Subject: [PATCH] various fixes for CPS compatibility

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1442 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ZSQLCatalog/SQLCatalog.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/product/ZSQLCatalog/SQLCatalog.py b/product/ZSQLCatalog/SQLCatalog.py
index b1bd160e37..d394b039bc 100755
--- a/product/ZSQLCatalog/SQLCatalog.py
+++ b/product/ZSQLCatalog/SQLCatalog.py
@@ -21,6 +21,7 @@ from thread import get_ident
 from DateTime import DateTime
 from Products.PluginIndexes.common.randid import randid
 from Products.CMFCore.Expression import Expression
+from Products.CMFCore.utils import getToolByName
 from Acquisition import aq_parent, aq_inner, aq_base, aq_self
 from zLOG import LOG
 
@@ -314,7 +315,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
         # LOG
         # LOG("Call SQL Method %s with args:" % method_name,0, str(kw))
         # Alter row
-        #LOG("Call SQL Method %s with args:" % method_name,0, str(kw))
+        LOG("Call SQL Method %s with args:" % method_name,0, str(kw))
         method(**kw)
     else:
       # Get the appropriate SQL Method
@@ -383,6 +384,12 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
         kw['path'] = path
         kw['uid'] = index
         kw['insert_catalog_line'] = insert_catalog_line
+        # Alter/Create row       
+        zope_root = getToolByName(self, 'portal_url').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)
         # LOG
         # Alter row
         # Create row
@@ -697,6 +704,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
     # The used argument is deprecated and is ignored
     try:
       # Get the search method
+      LOG("searchResults: kw:",0,str(kw))
       method = getattr(self, self.sql_search_results)
 
       # Return the result
-- 
2.30.9