我正在使用Plone 4.0.1并且搜索portlet存在问题。正常搜索和实时搜索工作正常,但当我尝试使用高级搜索(通过mysite / search_form)时,我得到以下错误堆栈:
Traceback (innermost last):
Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 47, in call_object
Module Shared.DC.Scripts.Bindings, line 324, in __call__
Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
Module Products.CMFCore.FSPageTemplate, line 240, in _exec
Module Products.CMFCore.FSPageTemplate, line 180, in pt_render
Module Products.PageTemplates.PageTemplate, line 80, in pt_render
Module zope.pagetemplate.pagetemplate, line 115, 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 821, in do_loop_tal
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 633, in do_insertI18nText_tal
Module Products.PageTemplates.Expressions, line 227, in evaluateText
Module zope.tales.tales, line 696, in evaluate
- URL: file:/usr/local/Plone/buildout-cache/eggs/Plone-4.0.1-py2.6.egg/Products/CMFPlone/skins/plone_forms/search_form.pt
- Line 162, Column 24
- Expression: <PythonExpr portal_types.getTypeInfo(type).Title()>
- Names:
{'container': <PloneSite at /PROJECT>,
'context': <PloneSite at /PROJECT>,
'default': <object object at 0x7fe10cfc7ae0>,
'here': <PloneSite at /PROJECT>,
'loop': {u'sublist': <Products.PageTemplates.Expressions.PathIterator object at 0xc0c58d0>,
u'type': <Products.PageTemplates.Expressions.PathIterator object at 0xc0c5a50>},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xc0fad08>,
'request': <HTTPRequest, URL=http://www.PROJECT/search_form>,
'root': <Application at >,
'template': <FSPageTemplate at /PROJECT/search_form>,
'traverse_subpath': [],
'user': <PloneUser 'USER@MAIL.COM'>}
Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
- __traceback_info__: portal_types.getTypeInfo(type).Title()
Module PythonExpr, line 1, in <expression>
Module AccessControl.ImplPython, line 688, in guarded_getattr
AttributeError: 'NoneType' object has no attribute 'Title'
感谢您的帮助!
答案 0 :(得分:2)
您似乎对portal_types有问题,请检查一切是否正常。也许是一个内容类型,名称中包含一些名称或者产品损坏?
答案 1 :(得分:0)
这可以通过适当类型的类型导入来解决。包装简介。
有一些产品或Zope插件已经安装了一半。
强力修复是重新安装所有插件,希望其中一个插件会注册该类型。
然而,对于更“完美主义”的方法:
查找违规类型
使用Products.PDBDebugMode在fg中运行zope(这使得plone在异常时输入pdb)
AttributeError: 'NoneType' object has no attribute 'Title'
> /path/to/your/plone/instance/PythonExpr(1)<expression>()
(Pdb) portal_types
<TypesTool at /plonesite/portal_types>
(Pdb) type
'NameOfOffendingType' #### <------ HERE!!!!!!
(Pdb) portal_types.getTypeInfo(type) is None
True ####<--- yup, sure is!!!
2)访问ZMI并在您的plone网站下,检查类型工具。您应该注意到未列出步骤1中标识的违规类型。
3)找到定义此Object的python包和配置文件'types.xml': 你应该在types.xml中看到这个(希望如此)
<object name="NameOfOffendingType"
meta_type="Factory-based Type Information with dynamic views"/>
4)现在您已了解该软件包,访问ZMI并在您的plone站点下进入“门户网站设置”并单击“导入”选项卡。选择“选择配置文件或快照”下的包/产品(您可以在包的configure.zcml中找到配置文件名称)选择“类型工具”并单击“导入所选步骤”
5)从这里开始,您可以在步骤2中重新检查“类型工具”。您现在应该看到列出的“违规类型”。
6)返回并再次尝试高级搜索。也许这次会奏效。
答案 2 :(得分:-1)
可能是敏捷错误,Title的访问者返回None,目录将其缓存在元数据/大脑中 - 然后模板会阻塞。升级到Dexterity 1.0.3 - IIRC应该为你解决。