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): ...@@ -382,15 +382,15 @@ def synchronizeDynamicModules(context, force=False):
import traceback; traceback.print_exc() import traceback; traceback.print_exc()
raise raise
# It's okay for classes to keep references to old methods - maybe. # It's okay for classes to keep references to old methods - maybe.
# but we absolutely positively need to clear the workflow chains # but we absolutely positively need to clear the workflow chains
# stored in WorkflowMethod objects: our generation of workflow # stored in WorkflowMethod objects: our generation of workflow
# methods adds/registers/wraps existing methods, but does not # methods adds/registers/wraps existing methods, but does not
# remove old chains. Do it now. # remove old chains. Do it now.
resetRegisteredWorkflowMethod() resetRegisteredWorkflowMethod()
# Some method generations are based on portal methods, and portal # Some method generations are based on portal methods, and portal
# methods cache results. So it is safer to invalidate the cache. # methods cache results. So it is safer to invalidate the cache.
cache_tool = getattr(portal, 'portal_caches', None) cache_tool = getattr(portal, 'portal_caches', None)
if cache_tool is not None: if cache_tool is not None:
cache_tool.clearCache() 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