Commit 9b4f7bf9 authored by Michel Pelletier's avatar Michel Pelletier

Fixed resolve_url issues and removing items from catalog

parent 8ca4da9c
...@@ -217,7 +217,7 @@ class ZCatalog(Folder, FindSupport, Persistent, Implicit): ...@@ -217,7 +217,7 @@ class ZCatalog(Folder, FindSupport, Persistent, Implicit):
# if an error happens here, the catalog will be in # if an error happens here, the catalog will be in
# an unstable state. If this happens, ignore the # an unstable state. If this happens, ignore the
# object. # object.
obj = REQUEST.resolve_url(url, REQUEST) obj = self.resolve_url(url, REQUEST)
except: except:
continue continue
...@@ -229,11 +229,12 @@ class ZCatalog(Folder, FindSupport, Persistent, Implicit): ...@@ -229,11 +229,12 @@ class ZCatalog(Folder, FindSupport, Persistent, Implicit):
def manage_uncatalogObject(self, REQUEST, urls=None): def manage_uncatalogObject(self, REQUEST, urls=None):
""" removes Zope object 'urls' from catalog """ """ removes Zope object 'urls' from catalog """
## import pdb
## pdb.set_trace()
if urls: if urls:
for url in urls: for url in urls:
try: try:
obj = REQUEST.resolve_url(url, REQUEST) obj = self.resolve_url(url, REQUEST)
except: except:
continue continue
self.uncatalog_object(url) self.uncatalog_object(url)
...@@ -246,11 +247,11 @@ class ZCatalog(Folder, FindSupport, Persistent, Implicit): ...@@ -246,11 +247,11 @@ class ZCatalog(Folder, FindSupport, Persistent, Implicit):
""" clear the catalog, then re-index everything """ """ clear the catalog, then re-index everything """
paths = tuple(self._catalog.paths.values()) paths = tuple(self._catalog.paths.values())
self.manage_catalogClear() self.manage_catalogClear(REQUEST)
for p in paths: for p in paths:
try: try:
obj = REQUEST.resolve_url(p) obj = self.resolve_url(p, REQUEST)
self.catalog_object(obj, p) self.catalog_object(obj, p)
except: except:
pass pass
...@@ -369,9 +370,8 @@ class ZCatalog(Folder, FindSupport, Persistent, Implicit): ...@@ -369,9 +370,8 @@ class ZCatalog(Folder, FindSupport, Persistent, Implicit):
""" """
if REQUEST is None: if REQUEST is None:
REQUEST=self.REQUEST REQUEST=self.REQUEST
url='%s/%s' %(REQUEST.script, self.getpath(rid))
try: try:
obj = REQUEST.resolve_url(url) obj = self.resolve_url(self.getpath(rid), REQUEST)
except: except:
return None return None
return obj return obj
...@@ -498,8 +498,6 @@ class ZCatalog(Folder, FindSupport, Persistent, Implicit): ...@@ -498,8 +498,6 @@ class ZCatalog(Folder, FindSupport, Persistent, Implicit):
raise rsp.errmsg, sys.exc_value raise rsp.errmsg, sys.exc_value
Globals.default__class_init__(ZCatalog) Globals.default__class_init__(ZCatalog)
......
...@@ -47,7 +47,7 @@ can also remove or update individual catalog records. ...@@ -47,7 +47,7 @@ can also remove or update individual catalog records.
</TD> </TD>
<td valign="top"><dtml-var meta_type></td> <td valign="top"><dtml-var meta_type></td>
<td valign="top" align="left"> <td valign="top" align="left">
<a href="../<dtml-var "getpath(data_record_id_)">/manage_main"><dtml-var "getpath(data_record_id_)"> <a href="<dtml-var "getpath(data_record_id_)">/manage_main"><dtml-var "getpath(data_record_id_)">
<dtml-if title> (<dtml-var title>)</dtml-if></a> <dtml-if title> (<dtml-var title>)</dtml-if></a>
</td> </td>
</tr> </tr>
...@@ -73,7 +73,7 @@ can also remove or update individual catalog records. ...@@ -73,7 +73,7 @@ can also remove or update individual catalog records.
<dtml-else> <dtml-else>
<P>There are no entries in the Catalog.</P> <P>There are no objects in the Catalog.</P>
</dtml-if> </dtml-if>
...@@ -82,3 +82,6 @@ can also remove or update individual catalog records. ...@@ -82,3 +82,6 @@ can also remove or update individual catalog records.
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