Plone 查看一个自定义内容类型会产生AttributeError:';非类型';对象没有属性';getPhysicalPath';

Plone 查看一个自定义内容类型会产生AttributeError:';非类型';对象没有属性';getPhysicalPath';,plone,Plone,在很多帮助下(我是一个缺乏经验的程序员/Plone开发者),我在一个新的Plone网站上创建了一些自定义内容类型。我现在遇到一个错误。该内容类型称为“组织”,它有一个可选的多值引用字段,其“允许类型”为“站点”(我的另一个自定义内容类型)。我创造了大量的组织条目;都很好。然后我将其中一些链接到网站。他们保存的很好,但现在,一两周后,当我尝试查看其中任何一个时,会收到以下错误消息: 回溯(最里面的最后一个): 模块ZPublisher.Publish,Publish中的第127行 模块ZPubli

在很多帮助下(我是一个缺乏经验的程序员/Plone开发者),我在一个新的Plone网站上创建了一些自定义内容类型。我现在遇到一个错误。该内容类型称为“组织”,它有一个可选的多值引用字段,其“允许类型”为“站点”(我的另一个自定义内容类型)。我创造了大量的组织条目;都很好。然后我将其中一些链接到网站。他们保存的很好,但现在,一两周后,当我尝试查看其中任何一个时,会收到以下错误消息:

回溯(最里面的最后一个):

模块ZPublisher.Publish,Publish中的第127行
模块ZPublisher.mapply,第77行,在mapply中
模块ZPublisher.Publish,第47行,在call_对象中
模块Products.Five.browser.metaconfigure,第477行,in__调用__
模块Products.Five.browser.pagetemplatefile,第126行,在调用中__
模块Products.Five.browser.pagetemplatefile,第60行,在调用中__
模块zope.pagetemplate.pagetemplate,第113行,在pt_渲染中
模块zope.tal.t interpreter,第271行,输入调用__
模块zope.tal.t解释程序第343行
do_useMacro中的模块zope.tal.tInterpreter,第888行
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
do_defineSlot中模块zope.tal.tInterpreter,第954行
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
模块zope.tal.tInterpreter,第858行,在do_defineMacro中
模块zope.tal.t解释程序第343行
do_defineSlot中模块zope.tal.tInterpreter,第954行
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
模块zope.tal.t Interpreter,第946行,在do_defineSlot中
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
模块zope.tal.tInterpreter,第858行,在do_defineMacro中
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
do_useMacro中的模块zope.tal.tInterpreter,第888行
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
模块zope.tal.t第852行的interpreter处于do_状态
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
模块zope.tal.t第852行的interpreter处于do_状态
模块zope.tal.t解释程序第343行
模块zope.tal.tInterpreter,第821行,在do_循环中
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
do_setLocal_tal中模块zope.tal.tInterpreter,第583行
模块zope.tales.tales,第696行,在评估中
URL:file:/usr/local/Plone/buildout cache/eggs/archetypes.referencebrowserwidget-2.1-py2.6.egg/archetypes/referencebrowserwidget/skins/referencebrowser/referencebrowser.pt
第57行第12栏
表达方式:
姓名:
{'args':(),
“容器”:,
“上下文”:,
“默认值”:,
“这里”:,
'循环':{},
“没有”:没有,
“选项”:{},
“重复”:,
“请求”:,
“根”:
  • 问题内容类型之一是:
  • 请告知,如果你需要我张贴任何代码,我会这样做


    谢谢。

    似乎引用的对象不再存在。UUID无法查找它,因此引用目录中的某个位置不会返回任何对象(\u objectByUUID)

    我认为archetypes.referencebrowserwidget应该处理这种情况,但事实并非如此

    你还记得你提到过哪个网站吗?它还在吗? 您是否能够以某种方式删除引用并重新创建它


    干杯

    似乎引用的对象不再存在。UUID无法查找它,因此引用目录中的某个位置不会返回任何对象(_objectByUUID)

    我认为archetypes.referencebrowserwidget应该处理这种情况,但事实并非如此

    你还记得你提到过哪个网站吗?它还在吗? 您是否能够以某种方式删除引用并重新创建它


    干杯

    如果您以某种方式移动了组织,绕过了用于更新引用的机制,或者如果该机制以某种方式损坏,那么这就可以解释问题。我认为先清除引用目录和uid目录,然后进行“清除并重建”门户网站目录的“更新”按钮可能会解决您的问题。您会在门户网站目录的ZMI中找到“更新目录”下面的按钮,该按钮位于同一页面的中间
    Module ZPublisher.Publish, line 127, in publish
    Module ZPublisher.mapply, line 77, in mapply
    Module ZPublisher.Publish, line 47, in call_object
    Module Products.Five.browser.metaconfigure, line 477, in __call__
    Module Products.Five.browser.pagetemplatefile, line 126, in __call__
    Module Products.Five.browser.pagetemplatefile, line 60, in __call__
    Module zope.pagetemplate.pagetemplate, line 113, in pt_render
    Module zope.tal.talinterpreter, line 271, in __call__
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 888, in do_useMacro
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 533, in do_optTag_tal
    Module zope.tal.talinterpreter, line 518, in do_optTag
    Module zope.tal.talinterpreter, line 513, in no_tag
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 954, in do_defineSlot
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 533, in do_optTag_tal
    Module zope.tal.talinterpreter, line 518, in do_optTag
    Module zope.tal.talinterpreter, line 513, in no_tag
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 858, in do_defineMacro
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 954, in do_defineSlot
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 533, in do_optTag_tal
    Module zope.tal.talinterpreter, line 518, in do_optTag
    Module zope.tal.talinterpreter, line 513, in no_tag
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 946, in do_defineSlot
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 533, in do_optTag_tal
    Module zope.tal.talinterpreter, line 518, in do_optTag
    Module zope.tal.talinterpreter, line 513, in no_tag
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 858, in do_defineMacro
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 533, in do_optTag_tal
    Module zope.tal.talinterpreter, line 518, in do_optTag
    Module zope.tal.talinterpreter, line 513, in no_tag
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 888, in do_useMacro
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 533, in do_optTag_tal
    Module zope.tal.talinterpreter, line 518, in do_optTag
    Module zope.tal.talinterpreter, line 513, in no_tag
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 852, in do_condition
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 533, in do_optTag_tal
    Module zope.tal.talinterpreter, line 518, in do_optTag
    Module zope.tal.talinterpreter, line 513, in no_tag
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 852, in do_condition
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 821, in do_loop_tal
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 533, in do_optTag_tal
    Module zope.tal.talinterpreter, line 518, in do_optTag
    Module zope.tal.talinterpreter, line 513, in no_tag
    Module zope.tal.talinterpreter, line 343, in interpret
    Module zope.tal.talinterpreter, line 583, in do_setLocal_tal
    Module zope.tales.tales, line 696, in evaluate
    URL: file:/usr/local/Plone/buildout-cache/eggs/archetypes.referencebrowserwidget-2.1-py2.6.egg/archetypes/referencebrowserwidget/skins/referencebrowser/referencebrowser.pt
    Line 57, Column 12
    Expression: <PythonExpr '/'.join(obj.getPhysicalPath())>
    Names:
    
    {'args': (),
     'container': <Organisation at /ecn/what-we-do/about/sponsors/ccw>,
     'context': <Organisation at /ecn/what-we-do/about/sponsors/ccw>,
     'default': <object object at 0xb75f86d0>,
     'here': <Organisation at /ecn/what-we-do/about/sponsors/ccw>,
     'loop': {},
     'nothing': None,
     'options': {},
     'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xcadb89c>,
     'request': <HTTPRequest, URL=http://la-ecnweb1.nerc-lancaster.ac.uk:8080/ecn/what-we-do/about/sponsors/ccw/organisation_view>,
     'root': <Application at >,
     'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xaa4154c>,
     'traverse_subpath': [],
     'user': <PropertiedUser 'admin'>,
     'view': <Products.Five.metaclass.SimpleViewClass from /usr/local/Plone/zinstance/src/ceh.ecn_theme/ceh/ecn_theme/browser/templates/organisation_view.pt object at 0xc926aec>,
     'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0xc926aac>}
    
    Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
    __traceback_info__: '/'.join(obj.getPhysicalPath())
    Module PythonExpr, line 1, in <expression>
    
    Clear and Rebuild will remove all entries from the catalog, and then walk the entire portal looking for content objects which should be indexed in the catalog and index them. Doing this will remove inappropriate entries from the portal catalog (scripts, templates) and preserve all indexed content. This may take a long time, but it is the correct way to rebuild a catalog that has had objects improperly added or removed.
    
    >>> portal = app.unrestrictedTraverse('/portal_name')
    >>> org = portal.unrestrictedTraverse('path/to/buggy/organization') # no leading slash
    >>> broken = [item for item in org.getReferenceImpl(field_relationship) if item.getTargetObject() is None]
    >>> brains = portal.uid_catalog.unrestrictedSearchResults(UID=[item.targetUID for item in broken])
    >>> from pprint import pprint
    >>> pprint([brain.getPath() for brain in brains])
    
    <label tal:define="title set/title_or_id | string:Undisclosed;
                       obj_path python: set and '/'.join(set.getPhysicalPath()) or None;">
       <input type="checkbox" 
              tal:attributes="name string:${fieldName}:list;
                              value python:helper.getUidFromReference(set);
                              checked python: set and 'checked' or None;
                              style python: not set and 'display:none' or None;" 
               checked="checked" />