ComponentLookupError 在基于 z3c.form 的表单 updateWidgets() 上引发
ComponentLookupError raised on z3c.form based form updateWidgets()
只有在我从 configure.zcml
文件中删除 <includeDependencies package="." />
指令后,我才在 运行 测试时遇到此问题:
Error in test test_get_load_action (sc.embedder.tests.test_content.MultimediaTestCase)
Traceback (most recent call last):
File "/home/hvelarde/collective/buildout.python/parts/opt/lib/python2.7/unittest/case.py", line 329, in run
testMethod()
File "/home/hvelarde/collective/sc.embedder/src/sc/embedder/tests/test_content.py", line 135, in test_get_load_action
edit_form.update()
File "/home/hvelarde/.buildout/eggs/plone.dexterity-1.1.2-py2.7.egg/plone/dexterity/browser/edit.py", line 52, in update
super(DefaultEditForm, self).update()
File "/home/hvelarde/.buildout/eggs/plone.z3cform-0.7.8-py2.7.egg/plone/z3cform/fieldsets/extensible.py", line 59, in update
super(ExtensibleForm, self).update()
File "/home/hvelarde/.buildout/eggs/plone.z3cform-0.7.8-py2.7.egg/plone/z3cform/patch.py", line 30, in GroupForm_update
_original_GroupForm_update(self)
File "/home/hvelarde/.buildout/eggs/z3c.form-2.5.1-py2.7.egg/z3c/form/group.py", line 125, in update
self.updateWidgets()
File "/home/hvelarde/.buildout/eggs/z3c.form-2.5.1-py2.7.egg/z3c/form/form.py", line 129, in updateWidgets
(self, self.request, self.getContent()), interfaces.IWidgets)
File "/home/hvelarde/.buildout/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 109, in getMultiAdapter
raise ComponentLookupError(objects, interface, name)
ComponentLookupError: ((<Products.Five.metaclass.EditForm object at 0x7f5262a3f490>, <HTTPRequest, URL=http://nohost>, <Embedder at /plone/test-folder/multimedia>), <InterfaceClass z3c.form.interfaces.IWidgets>, u'')
之前工作的相同版本;当前 configure.zcml
现在包括以下内容:
<include package="Products.CMFCore" file="permissions.zcml" />
<include package="plone.app.dexterity" />
<include package="plone.app.dexterity" file="meta.zcml" />
<include package="five.grok" />
According to the documentation 由于迁移不当,这是一个已知问题,但事实并非如此。
我正在 Plone 4.2.6 下进行测试。与 you can see in the CI builds.
相同的代码在 Plone 4.3 下工作和测试通过
似乎我在 configure.zcml 声明中遗漏了一个包裹;现在看起来像这样:
<include package="Products.CMFCore" file="permissions.zcml" />
<include package="plone.app.dexterity" />
<include package="plone.app.dexterity" file="meta.zcml" />
<include package="collective.dexteritytextindexer" />
现在正在工作:https://travis-ci.org/simplesconsultoria/sc.embedder/builds/126432050
只有在我从 configure.zcml
文件中删除 <includeDependencies package="." />
指令后,我才在 运行 测试时遇到此问题:
Error in test test_get_load_action (sc.embedder.tests.test_content.MultimediaTestCase)
Traceback (most recent call last):
File "/home/hvelarde/collective/buildout.python/parts/opt/lib/python2.7/unittest/case.py", line 329, in run
testMethod()
File "/home/hvelarde/collective/sc.embedder/src/sc/embedder/tests/test_content.py", line 135, in test_get_load_action
edit_form.update()
File "/home/hvelarde/.buildout/eggs/plone.dexterity-1.1.2-py2.7.egg/plone/dexterity/browser/edit.py", line 52, in update
super(DefaultEditForm, self).update()
File "/home/hvelarde/.buildout/eggs/plone.z3cform-0.7.8-py2.7.egg/plone/z3cform/fieldsets/extensible.py", line 59, in update
super(ExtensibleForm, self).update()
File "/home/hvelarde/.buildout/eggs/plone.z3cform-0.7.8-py2.7.egg/plone/z3cform/patch.py", line 30, in GroupForm_update
_original_GroupForm_update(self)
File "/home/hvelarde/.buildout/eggs/z3c.form-2.5.1-py2.7.egg/z3c/form/group.py", line 125, in update
self.updateWidgets()
File "/home/hvelarde/.buildout/eggs/z3c.form-2.5.1-py2.7.egg/z3c/form/form.py", line 129, in updateWidgets
(self, self.request, self.getContent()), interfaces.IWidgets)
File "/home/hvelarde/.buildout/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 109, in getMultiAdapter
raise ComponentLookupError(objects, interface, name)
ComponentLookupError: ((<Products.Five.metaclass.EditForm object at 0x7f5262a3f490>, <HTTPRequest, URL=http://nohost>, <Embedder at /plone/test-folder/multimedia>), <InterfaceClass z3c.form.interfaces.IWidgets>, u'')
之前工作的相同版本;当前 configure.zcml
现在包括以下内容:
<include package="Products.CMFCore" file="permissions.zcml" />
<include package="plone.app.dexterity" />
<include package="plone.app.dexterity" file="meta.zcml" />
<include package="five.grok" />
According to the documentation 由于迁移不当,这是一个已知问题,但事实并非如此。
我正在 Plone 4.2.6 下进行测试。与 you can see in the CI builds.
相同的代码在 Plone 4.3 下工作和测试通过似乎我在 configure.zcml 声明中遗漏了一个包裹;现在看起来像这样:
<include package="Products.CMFCore" file="permissions.zcml" />
<include package="plone.app.dexterity" />
<include package="plone.app.dexterity" file="meta.zcml" />
<include package="collective.dexteritytextindexer" />
现在正在工作:https://travis-ci.org/simplesconsultoria/sc.embedder/builds/126432050