Commit 835757a5 authored by Julien Muchembled's avatar Julien Muchembled

Fix use of IActionProvider in ActionsTool patches for Zope 2.12

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29638 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent df586d48
......@@ -12,7 +12,14 @@
#
##############################################################################
from Products.CMFCore.ActionsTool import ActionsTool, IActionProvider
from Products.CMFCore.ActionsTool import ActionsTool
try:
from Products.CMFCore.interfaces import IActionProvider
providedBy = IActionProvider.providedBy
except ImportError:
# XXX Do not initialize ZCML in unit tests on Zope 2.8 for the moment
from Products.CMFCore.ActionsTool import IActionProvider
providedBy = IActionProvider.isImplementedBy
ActionsTool_listFilteredActionsFor = ActionsTool.listFilteredActionsFor
......@@ -27,7 +34,7 @@ def listFilteredActionsFor(self, object=None):
# Include actions from specific tools.
for provider_name in self.listActionProviders():
provider = getattr(self, provider_name)
if IActionProvider.isImplementedBy(provider):
if providedBy(provider):
actions.extend( provider.listActionInfos(object=object) )
elif hasattr(provider, 'getFilteredActionListFor'):
from Products.ERP5Type.Utils import createExpressionContext
......
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