[Erp5-report] r43097 nicolas.dumazet - /erp5/trunk/products/ERP5Type/dynamic/

nobody at svn.erp5.org nobody at svn.erp5.org
Sat Feb 5 07:26:25 CET 2011


Author: nicolas.dumazet
Date: Sat Feb  5 07:26:25 2011
New Revision: 43097

URL: http://svn.erp5.org?rev=43097&view=rev
Log:
We left out workflow resets during our aq_reset to resetDynamicDocuments switch
in r43009. This was a mistake: add it again and explain why it's required.

This fixes the last 2 failures of testBase

Modified:
    erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py

Modified: erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py?rev=43097&r1=43096&r2=43097&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py [utf8] Sat Feb  5 07:26:25 2011
@@ -37,7 +37,7 @@ from accessor_holder import _generateBas
 
 
 from Products.ERP5Type.mixin.temporary import TemporaryDocumentMixin
-from Products.ERP5Type.Base import _aq_reset, Base
+from Products.ERP5Type.Base import Base, resetRegisteredWorkflowMethod
 from Products.ERP5Type.Globals import InitializeClass
 from Products.ERP5Type.Utils import setDefaultClassProperties
 from Products.ERP5Type import document_class_registry, mixin_class_registry
@@ -494,6 +494,13 @@ def synchronizeDynamicModules(context, f
   finally:
     Base.aq_method_lock.release()
 
+  # It's okay for classes to keep references to old methods - maybe.
+  # but we absolutely positively need to clear the workflow chains
+  # stored in WorkflowMethod objects: our generation of workflow
+  # methods adds/registers/wraps existing methods, but does not
+  # remove old chains. Do it now.
+  resetRegisteredWorkflowMethod()
+
   # Some method generations are based on portal methods, and portal
   # methods cache results. So it is safer to invalidate the cache.
   cache_tool = getattr(context, 'portal_caches', None)



More information about the Erp5-report mailing list