首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ComponentLookupError在基于z3c.form的表单updateWidgets()上提出

ComponentLookupError在基于z3c.form的表单updateWidgets()上提出
EN

Stack Overflow用户
提问于 2016-04-27 18:34:19
回答 1查看 48关注 0票数 1

只有在我从我的<includeDependencies package="." />文件中删除了configure.zcml指令之后,我才会在运行测试时遇到这个问题:

代码语言:javascript
复制
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现在包括以下内容:

代码语言:javascript
复制
<include package="Products.CMFCore" file="permissions.zcml" />
<include package="plone.app.dexterity" />
<include package="plone.app.dexterity" file="meta.zcml" />
<include package="five.grok" />

根据文件 --这是一个已知的问题,因为迁移不好,但事实并非如此。

我在Plone 4.2.6下进行测试。在plone4.3下通过的代码和测试与您可以在CI构建中看到相同。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-04-28 16:37:02

似乎我在configure.zcml声明中缺少了一个包;现在看起来如下所示:

代码语言:javascript
复制
<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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36898150

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档