Make tests work without loading zcml for the moment.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29900 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6b809d2d
......@@ -2446,16 +2446,22 @@ class ActionTemplateItem(ObjectTemplateItem):
# Following code is for actions outside Types Tool.
# It will be removed when they are also converted to ERP5 actions.
from Products.CMFCore.interfaces import IActionProvider
if not IActionProvider.providedBy(container):
# some tools stopped being ActionProviders in CMF 2.x. Drop the
# action into portal_actions.
LOG('Products.ERP5.Document.BusinessTemplate', WARNING,
'Misplaced action',
'Attempted to store action %r in %r which is no longer an '
'IActionProvided. Storing action on portal_actions instead' %
(id, path))
container = p.portal_actions
try:
from Products.CMFCore.interfaces import IActionProvider
except ImportError:
# we still don't load ZCML on tests on 2.8, but on 2.8 we don't
# need to redirect actions to portal_actions.
pass
else:
if not IActionProvider.providedBy(container):
# some tools stopped being ActionProviders in CMF 2.x. Drop the
# action into portal_actions.
LOG('Products.ERP5.Document.BusinessTemplate', WARNING,
'Misplaced action',
'Attempted to store action %r in %r which is no longer an '
'IActionProvided. Storing action on portal_actions instead' %
(id, path))
container = p.portal_actions
obj, action = container, obj
action_list = obj.listActions()
for index in range(len(action_list)):
......
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