Re: [Zope] Products have incorrect "home" attribute
On 1/18/06, Andreas Jung <lists@andreas-jung.com> wrote:
What and where is the 'home' attribute?????
In lib/python/App/Product.py line 549: product.home=home 'home' is the product path as determined by OFS.Application.install_product; it looks, from a cursory glance, that this should be reset every time Zope is restart. It should be perfectly safe to delete the Products from your Control Panel Products folder and restart Zope to have them recreated though. If you don't trust this procedure, back up the ZODB, but from my reading this should happen every time you start Zope anyway. -- Martijn Pieters
--On 18. Januar 2006 08:19:25 +0100 Martijn Pieters <mj@zopatista.com> wrote:
On 1/18/06, Andreas Jung <lists@andreas-jung.com> wrote:
What and where is the 'home' attribute?????
In lib/python/App/Product.py line 549:
product.home=home
'home' is the product path as determined by OFS.Application.install_product; it looks, from a cursory glance, that this should be reset every time Zope is restart.
huuh...never seen that...looks like a culprit...who actually uses that information? Isn't package_home() doing the same? -aj
En/na Andreas Jung ha escrit:
--On 18. Januar 2006 08:19:25 +0100 Martijn Pieters <mj@zopatista.com> wrote:
On 1/18/06, Andreas Jung <lists@andreas-jung.com> wrote:
What and where is the 'home' attribute?????
In lib/python/App/Product.py line 549:
product.home=home
'home' is the product path as determined by OFS.Application.install_product; it looks, from a cursory glance, that this should be reset every time Zope is restart.
I asked the same question a couple of days ago (see "wrong directoy in Control_Panel.Products.XXXX.home") and no, they aren't reset at zope restart, and deleting the pyc files doesn't help either.
huuh...never seen that...looks like a culprit...who actually uses that information?
CMFQuickInstaller does (and breaks if you move your zope instance)
Isn't package_home() doing the same?
funny that you ask since I just noticed that CMFQuickInstaller imports the function then never uses it. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007
On 1/18/06, Luca Olivetti <luca@wetron.es> wrote:
I asked the same question a couple of days ago (see "wrong directoy in Control_Panel.Products.XXXX.home") and no, they aren't reset at zope restart, and deleting the pyc files doesn't help either.
Strange. If you are comfortable with the pdb debugger, you can debug the code in OFS.Application.install_products by adding a 'import pdb; pdb.set_trace()' before line 615 and see what get_products and install_product do, focussing on the product_dir variable, and how it eventually makes its way to the home property. -- Martijn Pieters
I asked the same question a couple of days ago (see "wrong directoy in Control_Panel.Products.XXXX.home") and no, they aren't reset at zope restart, and deleting the pyc files doesn't help either.
Thanks, didn't see the previous conversation. =) I'll do the delete the Products objects trick ... any idea why it fails to just directly change the attribute with an external method? I'm not savvy to the inner workings of ZODB so I don't know if there's read-only attributes or persistence issues (with a string attribute though?) here... Peace, Geroge
Martijn Pieters wrote at 2006-1-18 08:19 +0100:
... It should be perfectly safe to delete the Products from your Control Panel Products folder and restart Zope to have them recreated though. If you don't trust this procedure, back up the ZODB, but from my reading this should happen every time you start Zope anyway.
Please don't: it would make running from a read only storage much more difficult.... Up to now only a few products (such as "Formulator") try to write into the ZODB on any startup. I would not like to see all products doing that. -- Dieter
On 1/18/06, Dieter Maurer <dieter@handshake.de> wrote:
If you don't trust this procedure, back up the ZODB, but from my reading this should happen every time you start Zope anyway.
Please don't: it would make running from a read only storage much more difficult....
Indeed. Had I the time, I certainly would be diving deeper into this; a quick scan of the code doesn't quite build the required understanding, especially when you take read-only situations into account. -- Martijn Pieters
participants (5)
-
Andreas Jung -
Dieter Maurer -
George Lee -
Luca Olivetti -
Martijn Pieters