gpt4 book ai didi

plone - 如何修复 zc.relation 目录中的 KeyError

转载 作者:行者123 更新时间:2023-12-01 07:38:41 24 4
gpt4 key购买 nike

我们的一个网站有一个损坏的关系目录,我不知道如何修复它。

这是我在日志中看到的:

2015-11-20T09:27:43 ERROR Zope.SiteErrorLog 1448018863.240.913599974037 http://www.example.com/folder/news-item/@@edit
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module z3c.form.form, line 218, in __call__
Module collective.nitf.browser, line 64, in update
Module plone.dexterity.browser.edit, line 62, in update
Module plone.z3cform.fieldsets.extensible, line 59, in update
Module plone.z3cform.patch, line 30, in GroupForm_update
Module z3c.form.group, line 145, in update
Module plone.app.z3cform.csrf, line 21, in execute
Module z3c.form.action, line 98, in execute
Module z3c.form.button, line 315, in __call__
Module z3c.form.button, line 170, in __call__
Module plone.dexterity.browser.edit, line 26, in handleApply
Module z3c.form.group, line 126, in applyChanges
Module zope.event, line 31, in notify
Module zope.component.event, line 24, in dispatch
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module zope.component.event, line 32, in objectEventNotify
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module z3c.relationfield.event, line 76, in updateRelations
Module zc.relation.catalog, line 546, in unindex
Module zc.relation.catalog, line 556, in unindex_doc
Module zc.relation.catalog, line 622, in _remove
KeyError: 304600783

我已经尝试过 The dreaded plone.relations IntId KeyError 中的代码,由 @martijn-pieters 几年前编写,但似乎不再有效,因为我找不到任何名为 IComplexRelationshipContainer 的接口(interface)。

有什么提示吗?

最佳答案

例如。

from zope.component.hooks import setSite
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
from Testing.makerequest import makerequest
from Products.CMFCore.tests.base.security import PermissiveSecurityPolicy, OmnipotentUser
from zope.component import getUtility
from zope.intid.interfaces import IIntIds
from zc.relation.interfaces import ICatalog
_policy=PermissiveSecurityPolicy()
_oldpolicy=setSecurityPolicy(_policy)
newSecurityManager(None, OmnipotentUser().__of__(app.acl_users))

portal = makerequest(app['Plone'])
setSite(portal)

intids = getUtility(IIntIds)
catalog = getUtility(ICatalog)

print [x.from_object for x in sorted(catalog.findRelations({}))]

关于plone - 如何修复 zc.relation 目录中的 KeyError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33826101/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com