Register workflows the CMF2 way even under CFM1 so tests only need to use the...

Register workflows the CMF2 way even under CFM1 so tests only need to use the CMF2 way of creating workflows

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31628 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8fa68dca
...@@ -38,17 +38,14 @@ from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition ...@@ -38,17 +38,14 @@ from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition
_workflow_factories = {} _workflow_factories = {}
try: try:
from Products.CMFCore.WorkflowTool import addWorkflowFactory from Products.CMFCore.WorkflowTool import addWorkflowFactory as baseAddWorkflowFactory
# We're on CMF 1.5 # We're on CMF 1.5
except ImportError: except ImportError:
# We're on CMF 2 # We're on CMF 2
zLOG.LOG('Products.ERP5Type.Workflow.addWorkflowFactory', def baseAddWorkflowFactory(factory, id, tittle):
zLOG.INFO, pass
summary='Registering Workflow Factories Directly',
detail='Products.CMFCore.WorkflowTool.addWorkflowFactory has ' def addWorkflowFactory(factory, id, title):
'been removed from CMFCore. Workflows will be registered as '
'Zope 2 style factories instead.')
def addWorkflowFactory(factory, id, title):
"""addWorkflowFactory replacement """addWorkflowFactory replacement
addWorkflowFactory has been removed from CMFCore 2.x. addWorkflowFactory has been removed from CMFCore 2.x.
...@@ -66,6 +63,8 @@ except ImportError: ...@@ -66,6 +63,8 @@ except ImportError:
id=id, id=id,
title=title) title=title)
_workflow_factories[id] = factory_info _workflow_factories[id] = factory_info
# register with CMF 1 if it's still there
baseAddWorkflowFactory(factory, id, title)
# Workflow Creation DTML # Workflow Creation DTML
manage_addWorkflowFormDtml = HTMLFile('dtml/addWorkflow', globals()) manage_addWorkflowFormDtml = HTMLFile('dtml/addWorkflow', globals())
......
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