如何在plone中编辑使用uwosh.pfg.d2c适配器保存的数据条目?

时间:2012-07-30 04:52:34

标签: python plone ploneformgen

我使用了ploneformgen来创建输入表单。 当我尝试使用编辑选项卡在表单中使用uwosk.pfg.d2c适配器编辑保存的数据条目时,出现以下错误:

<FSControllerPythonScript at /MySite/update_version_on_edit used for /MySite/materials-requirement/material-requirement-form/requirement-for-approval/trial>
    Line 11
    Module Products.CMFEditions.utilities, line 109, in isObjectChanged
    Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 415, in isUpToDate
    Module Products.CMFEditions.ArchivistTool, line 396, in isUpToDate
    Module Products.CMFEditions.ZVCStorageTool, line 308, in getModificationDate
    Module Products.Archetypes.ExtensibleMetadata, line 455, in modified
    Module Products.Archetypes.BaseObject, line 237, in getField
    Module Products.Archetypes.BaseObject, line 821, in Schema
    Module zope.component.hooks, line 104, in adapter_hook
    Module archetypes.schemaextender.extender, line 146, in cachingInstanceSchemaFactory
    Module archetypes.schemaextender.extender, line 186, in instanceSchemaFactory
    Module plone.memoize.instance, line 51, in memogetter
    Module uwosh.pfg.d2c.extender, line 217, in getFields
    Module uwosh.pfg.d2c.content.dataentry, line 39, in getForm
    Module uwosh.pfg.d2c.content.dataentry, line 53, in getFormAdapter
    Module Products.CMFCore.utils, line 123, in getToolByName
    AttributeError: uid_catalog

如何修复此错误。我需要使用GUI或ZMI的步骤。我使用plone 4.1,ploneformgen 1.7.1和d2c adapter 2.1.5

1 个答案:

答案 0 :(得分:1)

看起来产品与CMFEditions结合使用。尝试编辑uwosh.pfg.d2c.content.dataentry以在顶部添加导入,然后更改第53行以通过其他路径转到uid_catalog

您需要先找到该文件;在uwosh.pfg.d2c脚本中搜索bin/instance。那会给你鸡蛋的位置。在鸡蛋中,找到文件uwosh/pfg/d2c/content/dataentry.py并在编辑器中打开它。

在顶部,使用其他import语句,添加以下行:

from zope.app.component.hooks import getSite

并改变第54行(第53行,但你在顶部添加了一行);它当前读作:

catalog = getToolByName(self, 'uid_catalog')

您将self更改为getSite()以将其读取:

catalog = getToolByName(getSite(), 'uid_catalog')

以这种方式改变鸡蛋便携;您必须为网站的每次安装执行此操作。如果上述更改对您有效,请将其报告给包装的作者,以便在新版本中修复。

目前,issue tracker包中存在一个似乎相关的问题,请参阅issue 7,您可以在此处跟进此问题。或者,您可以在新GitHub issue tracker for this package中提交票证。

是的,包裹作者Nathan van Gheem也经常光顾Stack Overflow,但你不应指望他在这里发现这个问题。在支持的位置提交问题意味着更多人可以找到它并提供帮助