Commit 394da7ba authored by Arnaud Fontaine's avatar Arnaud Fontaine

Portal Types Classes: Fix race condition on reset with Workflod Methods.

Sometimes, after saving a Component, Interaction Workflows Methods were not
created, thus reset could not be done later on.
parent ebdc7988
......@@ -382,15 +382,15 @@ def synchronizeDynamicModules(context, force=False):
import traceback; traceback.print_exc()
raise
# 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(portal, 'portal_caches', None)
if cache_tool is not None:
cache_tool.clearCache()
# 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(portal, 'portal_caches', None)
if cache_tool is not None:
cache_tool.clearCache()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment