[ZCM] [ZC] 248/ 1 Request "refresh does not work for products initialized in the old style"

Collector: Zope Bugs and Patches ... zope-coders@zope.org
Tue, 26 Feb 2002 17:49:38 -0500


Issue #248 Update (Request) "refresh does not work for products initialized in the old style"
 Status Pending, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/248

==============================================================
= Request - Entry #1 by d.maurer on Feb 26, 2002 5:49 pm

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.

==============================================================