[Zope] [Bug] refresh does not work for products initialized in the old style

Dieter Maurer dieter@handshake.de
Tue, 26 Feb 2002 23:51:52 +0100


Recently, someone complaint about being unable to refresh his product.

   After the first refresh, he was unable create new instances of
   his product. He got an unintelligent error message:
   "AttributeError: None object does not have attribute _setObject"

I just found out why this happens:

   Products using old style initializations install their
   constructors as methods of "Folder.Folder".

   When the product is reinstalled during a refresh, then
   in "OFS.Application.install_product" it is checked whether
   "Folder.Folder" already has the method. It has! The
   old method from the time before the refresh.
   Therefore, the old constructors remain installed.

   I do not yet understand, why a "self" that should be a folder
   is passed as None, but I am convinced it has to do with
   the outdated constructor in "Folder.Folder".

Upgrading to new style initialization works around the problem.


Dieter