2011-10-13 55 views
2

我正在使用Plone 4.0.1,并且在搜索portlet中遇到问题。正常的搜索和实时搜索做工精细,但当我尝试使用高级搜索(通过mysite的/ search_form),我收到以下错误堆栈:Plone高级搜索不起作用

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 '[email protected]'>} 
     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' 

感谢您的帮助!

回答

2

您似乎在portal_types有问题,请检查一切是否正常。也许某个名称中带有空格的内容类型,或者产品是否有问题?

+0

我确实有一些类型的没有标题,所以我手动设置,但它仍然无法正常工作。许多书名都有空格,你确定这可能是问题吗?我可以重新命名标题吗? –

+0

@Brandon:标题应该有空格。这是您需要担心的类型的“id”。如果你检查类型的URL,他们中的任何一个在链接中是否有'%20'或明显的空格? –

+0

非常感谢您的帮助,身份证是问题,高级搜索现在可以正常工作。 –

-1

可能是敏捷错误,Title的访问器返回None,目录将其缓存在元数据/大脑中 - 然后是模板扼流圈。升级到敏捷1.0.3 - IIRC应该为你解决。

+0

说明:敏捷升级后重新编制目录。 – sdupton

+0

我没有安装敏捷,当我安装它时,我的整个页面都无法工作...所以我不得不再次删除它。重新编制目录 - 没有敏捷性 - 也没有帮助。 –

+0

嗯,这是一个门户类型的问题(所以可能提供高级表单选择),与结果集无关。 –

0

这可以通过适当的类型导入&包配置文件来解决。

有一些产品或Zope加载项是一半安装的。

蛮力修复是重新安装所有插件,并希望其中一个插件将注册类型。


然而,对于更多的 “完美主义” 的方法:

  1. 查找与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)查找Python包和配置文件“的types.xml”定义此对象: 你应该在的types.xml看到这个地方(希望)

<object name="NameOfOffendingType" 
    meta_type="Factory-based Type Information with dynamic views"/> 

4)现在,你知道包,访问ZMI并在你的plone站点下进入'portal setup'并点击'import'选项卡。选择“选择配置文件或快照”下的Package/Product(您可以在Package的configure.zcml中找到配置文件名称)选择'Types Tool'并点击'Import Selected Steps'请在第2步中重新检查类型工具。现在您应该看到列出的“违规类型”。

6)返回并再次尝试高级搜索。也许这次会起作用。

http://rpatterson.net/blog/products.pdbdebugmode-egg

+0

是的,他们使用变量名'type'。这不是一个内置函数的无知的破坏 - 它只是真的很老的代码(pre python 2.2):) – FlipMcF