[Zope] zcatalog always catalogs whole site when using 'Find' tab.

Anthony Baxter anthony@interlink.com.au
Wed, 30 Jun 1999 15:11:00 +1000


first off, the ZCatalog tutorial has a chunk that includes example HTML,
without quoting it - search for 'Replace it with this:', it's the line
before and the line after.

next thing - if I add a ZCatalog to a subfolder, and do a 'find into 
catalog', the search will start at the top of the Zope tree. This seems 
unintuitive to me - it should only do the find from the folder object
containing the ZCatalog. (This is more in keeping with the behaviour of the
existing 'Find' tab)

the following will change ZCatalog to have this behaviour:

--- ZCatalog.py Wed Jun 30 15:00:23 1999
+++ ZCatalog.py.orig    Wed Jun 30 14:56:10 1999
@@ -248,11 +248,11 @@
                                  obj_permission=None):
     
         """ Find object according to search criteria and Catalog them
         """
 
-        results = self.ZopeFind(REQUEST.PARENTS[1],
+        results = self.ZopeFind(REQUEST.PARENTS[-1],
                                 obj_metatypes=obj_metatypes,
                                 obj_ids=obj_ids,
                                 obj_searchterm=obj_searchterm,
                                 obj_expr=obj_expr,
                                 obj_mtime=obj_mtime,

Does this seem reasonable? Or should it be a checkbox in the 'Find'
page to specify whether to search the entire site?

Anthony