[Zope-dev] ghosts of removed products haunting ZSQL Methods?

Matthew T. Kromer matt@zope.com
Tue, 08 Jan 2002 16:47:47 -0500


John Ziniti wrote:

> I used to have the Product TrackerBase installed
> and have removed it.  Now, however, attempts to
> access the "Advanced" tab of ZSQL Methods is
> broken because a chain of events attempt to get
> info about a the non-existent Product:
>
> lib/python/Shared/DC/ZRDB/dtml/advanced.dtml calls
> manage_product_zclass_info
>
> ../ZRDB/DA.py.manage_product_zclass_info (line 546)
> calls self.aq_acquire('_getProductRegistryData')('zclasses')
>
> One of these items is the dict:
>   "{'id': 'Tracker', 'meta_type': 'Tracker',
>     'product': 'Tracker', 'meta_class': <ZClass instance at d55af0>}
>
> Then, line 548 calls "if hasattr(z._zclass_,'_p_deactivate')".
>
> The attempt to access z._zclass_ fails because this
> product doesn't exist.
>
> 1) the call to z._zclass_ doesn't actuallt do anything
>    except: ## Eek, persistent
>
> 2) Is this schizophrenic state my fault?
>
> 3) How to rectify the problem (Make *all* of Zope
>    know that TrackerBase is gone)?
>

Hi John,

I'm ready and eager to blame Z classes for everything :)

In this case, lets try to force ZClasses to fix themselves up by going 
into Zope at the python command line prompt

% cd lib/python
% python2.1.1
 >>> import Zope
 >>> app = Zope.app()
 >>> app.fixupZClassDependencies(rebuild=1)
 >>> get_transaction().commit()

Hopefully that will do it for you.