Brandon Flowers
Brandon Flowers

Reputation: 75

Plone advanced search doesn't work

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!

Upvotes: 2

Views: 380

Answers (3)

FlipMcF
FlipMcF

Reputation: 12877

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

Upvotes: 0

sdupton
sdupton

Reputation: 1869

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.

Upvotes: -1

Yuri
Yuri

Reputation: 1074

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?

Upvotes: 2

Related Questions