Cannot delete Object with wrong metatype
Hi! I'm trying to make a website for some weeks now and yesterday a noticed a real problem for me. One of the standardfiles index_html (DTML Method) changed it's metatype to a !Folder! I've tried to delete it several times with no success. Has someone a idea how to make it work again? Helmut
Helmut Toplitzer wrote:
Hi!
I'm trying to make a website for some weeks now and yesterday a noticed a real problem for me.
One of the standardfiles index_html (DTML Method) changed it's metatype to a !Folder!
I've tried to delete it several times with no success.
Has someone a idea how to make it work again?
Helmut
Hi! Its me again. I found a solution for the above Problem: Ist not the wrong metatype (it just looks like) its of the wrong class (broken product). I found the folowing solution for this (with a few deletions on the marked ---> lines becaus i cant patch the original file. marked lines deleted in original file.) (Solution from http://classic.zope.org:8080/Collector/1183/view ) After this patch try to delete the object, it should work. (maybe only in my case) When it's done, replace with the old file (lib/python/OFS/.) and restart, because of no warenties. --- ObjectManager.py 2000/05/11 18:54:14 1.89 +++ ObjectManager.py 2000/05/12 01:19:43 @@ -99,9 +99,13 @@ import marshal import App.Common ---> from AccessControl import getSecurityManager ---> +from zLOG import LOG, ERROR +import sys bad_id=ts_regex.compile('[^a-zA-Z0-9-_~\,\. ]').search #TS +class BeforeDeleteException( Exception ): pass # raise to veto deletion + _marker=[] class ObjectManager( CopySupport.CopyContainer, @@ -271,12 +275,26 @@ for object in self.objectValues(): try: s=object._p_changed except: s=0 - object.manage_beforeDelete(item, container) + try: + object.manage_beforeDelete(item, container) ----> + except BeforeDeleteException, ob: ----> + raise + except: ----> + LOG('Zope',ERROR,'manage_beforeDelete() threw', ----> + error=sys.exc_info()) + pass if s is None: object._p_deactivate() def _delObject(self, id, dp=1): object=self._getOb(id) - object.manage_beforeDelete(object, self) + try: + object.manage_beforeDelete(object, self) ----> + except BeforeDeleteException, ob: ----> + raise + except: ----> + LOG('Zope',ERROR,'manage_beforeDelete() threw', ----> + error=sys.exc_info()) + pass self._objects=tuple(filter(lambda i,n=id: i['id']!=n, self._objects)) self._delOb(id)
participants (1)
-
Helmut Toplitzer