Plone 高级搜索不起作用

发布于 2024-12-09 19:23:47 字数 5115 浏览 0 评论 0原文

我正在使用 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 '[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'

感谢您的帮助!

I'm using Plone 4.0.1 and have a problem with the search portlet. The normal search and live search work fine, but when I try to use the advanced search (via mysite/search_form), I get the following error stack:

    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'

Thanks for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

此岸叶落 2024-12-16 19:23:47

您的 Portal_types 似乎有问题,请检查那里是否一切正常。也许内容类型的名称中带有空格,或者是损坏的产品?

You seems to have something wrong with portal_types, check if all is ok there. Maybe a content type with some name with spaces inside the name, or broken products?

断爱 2024-12-16 19:23:47

这可以通过适当类型和类型的类型导入来解决。封装简介。

有一些产品或 Zope 附加组件安装了一半。

一种强力修复方法是重新安装所有插件,并希望其中一个插件能够注册该类型。


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

  1. 找到违规类型
    使用 Products.PDBDebugMode 在 fg 中运行 zope(这使得 plone 在异常时进入 pdb)

    AttributeError:“NoneType”对象没有属性“Title”
    > /path/to/your/plone/instance/PythonExpr(1)<表达式>()
    (Pdb)portal_types
    <类型工具位于 /plonesite/portal_types>
    (Pdb) 类型
    'NameOfOffendingType' #### <------ 这里!!!!!!
    (Pdb)portal_types.getTypeInfo(类型)为无
    真的####<--- 是的,当然是!!!
    

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”选项卡。在“选择配置文件或快照”下选择包/产品(您可以在包的configure.zcml中找到配置文件名称)选择“类型工具”并单击“导入所选步骤”

5)从这里,您可以重新检查步骤 2 中的类型工具。您现在应该会看到列出的“违规类型”。

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

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

This can be resolved with a types import of the appropriate type & package profile.

There is some product or Zope add-on that's half-installed.

A brute force fix is to re-install all your addons and hopefully one of the addons will register the type.


However, for the more "Perfectionist" approach:

  1. Find The Offending Type
    Run zope in fg with Products.PDBDebugMode (this makes plone enter pdb on exception)

    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) Visit the ZMI and under your plone site, check types tool. You should notice that the offending type identified in step 1 is not listed.

3) Find the python package and profile 'types.xml' that defines this Object:
you should see this in types.xml somewhere (hopefully)

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

4) Now that you know the package, Visit the ZMI and under your plone site go to 'portal setup' and click the 'import' tab. Choose the Package / Product under the "Select Profile or Snapshot" (you can find the profile name in the Package's configure.zcml) Select 'Types Tool' and click 'Import Selected Steps'

5) from here, you can go re-check the Types Tool in step 2. You should now see the "Offending Type" listed.

6) Go back and try the advanced search again. Maybe it will work this time.

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

失去的东西太少 2024-12-16 19:23:47

可能是敏捷性错误,标题的访问器返回 None,并且目录将其缓存在元数据/大脑中 - 然后模板就会阻塞。升级到 Dexterity 1.0.3 —— IIRC 应该可以解决你的问题。

Likely a Dexterity bug, the accessor for Title returns None, and the catalog caches this in metadata/brain -- then the template chokes. Upgrade to Dexterity 1.0.3 -- IIRC should solve for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文