Ticket #13104 (confirmed Bug)
@@search fails with attribute error for view.breadcrumbs(item)
Reported by: | jcruff@… | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 4.x |
Component: | General | Version: | 4.2 |
Keywords: | patch, tuneup | Cc: |
Description
live search works but clicking the search button produces a traceback for the expression 'view.breadcrumbs(item)' and generates "AttributeError: 'NoneType' object has no attribute 'absolute_url'".
TRACEBACK:
2012-08-13T10:21:09 ERROR Zope.SiteErrorLog 1344867669.670.43638162919 http://192.168.10.10:8070/Plone/@@search Traceback (innermost last): Module ZPublisher.Publish, line 126, in publish Module ZPublisher.mapply, line 77, in mapply Module ZPublisher.Publish, line 46, in call_object Module Products.Five.browser.metaconfigure, line 476, in __call__ Module Products.Five.browser.pagetemplatefile, line 125, in __call__ Module Products.Five.browser.pagetemplatefile, line 59, 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 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 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 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: /opt/Plone42/buildout-cache/eggs/plone.app.search-1.0.2-py2.7.egg/plone/app/search/search.pt - Line 341, Column 38 - Expression: <PythonExpr ( view.breadcrumbs(item))> - Names: {'args': (), 'container': <PloneSite at /Plone>, 'context': <PloneSite at /Plone>, 'default': <object object at 0xb77f57e0>, 'here': <PloneSite at /Plone>, 'loop': {}, 'nothing': None, 'options': {}, 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xafdbf93c>, 'request': <HTTPRequest, URL=http://192.168.10.10:8070/Plone/@@search>, 'root': <Application at >, 'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xafc7272c>, 'traverse_subpath': [], 'user': <SpecialUser 'Anonymous User'>, 'view': <Products.Five.metaclass.SimpleViewClass from /opt/Plone42/buildout-cache/eggs/plone.app.search-1.0.2-py2.7.egg/plone/app/search/search.pt object at 0xafd8c7ac>, 'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0xafd8cf4c>} Module zope.tales.pythonexpr, line 59, in __call__ - __traceback_info__: ( view.breadcrumbs(item)) Module <string>, line 1, in <module> Module plone.app.search.browser, line 150, in breadcrumbs Module quills.app.browser.breadcrumbs, line 28, in breadcrumbs Module Products.CMFPlone.browser.navigation, line 256, in breadcrumbs Module Products.CMFPlone.browser.navigation, line 44, in get_view_url Module Products.CMFPlone.browser.navigation, line 28, in get_url AttributeError: 'NoneType' object has no attribute 'absolute_url'
Attachments
Change History
comment:1 Changed 4 years ago by kleist
- Priority changed from minor to major
- Status changed from new to confirmed
- Component changed from Unknown to General
comment:2 Changed 4 years ago by techniq
Removed all quills add-ons, this included Products.Quills (1.8a1), Product.Quills Enabled (1.8a1), quills.app (1.8a1). Now I'm receiving a different traceback:
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 225, in evaluateText Module zope.tales.tales, line 696, in evaluate - URL: /opt/Plone42/buildout-cache/eggs/plone.app.search-1.0.2-py2.7.egg/plone/app/search/search.pt - Line 157, Column 46 - Expression: <PythonExpr ( portal_types.getTypeInfo(type).Title())> - Names: {'args': (), 'container': <PloneSite at /Plone>, 'context': <PloneSite at /Plone>, 'default': <object object at 0xb77f57e0>, 'here': <PloneSite at /Plone>, 'loop': {}, 'nothing': None, 'options': {}, 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xad685f2c>, 'request': <HTTPRequest, URL=http://192.168.10.10:8070/Plone/@@search>, 'root': <Application at >, 'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xafc7272c>, 'traverse_subpath': [], 'user': <PloneUser 'Techniq'>, 'view': <Products.Five.metaclass.SimpleViewClass from /opt/Plone42/buildout-cache/eggs/plone.app.search-1.0.2-py2.7.egg/plone/app/search/search.pt object at 0xadad47ac>, 'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0xad6841ec>} Module zope.tales.pythonexpr, line 59, in __call__ - __traceback_info__: ( portal_types.getTypeInfo(type).Title()) Module <string>, line 1, in <module> AttributeError: 'NoneType' object has no attribute 'Title'
comment:3 Changed 4 years ago by ddellaquila
I had the same issue with exactly the same second traceback posted by techniq.
In my case it looks like that for some reason portal_types.getTypeInfo(type).Title() was looking for the Title of a content type called Sitemap which it doesn't exit, therefore the NoneType error.
I don't know why is looking for such content type, anyway I fixed by adding some tal conditions to the template search.pt, you can find my patch attached.
comment:5 Changed 4 years ago by techniq
Thanks, I applied the patch but am now getting yet another traceback:
Module zope.tales.tales, line 696, in evaluate - URL: /opt/Plone42/buildout-cache/eggs/plone.app.search-1.0.2-py2.7.egg/plone/app/search/search.pt - Line 343, Column 38 - Expression: <PythonExpr ( view.breadcrumbs(item))> - Names: {'args': (), 'container': <PloneSite at /Plone>, 'context': <PloneSite at /Plone>, 'default': <object object at 0xb781e7e8>, 'here': <PloneSite at /Plone>, 'loop': {}, 'nothing': None, 'options': {}, 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xb2e6f20c>, 'request': <HTTPRequest, URL=http://digitaldojo.me/@@search>, 'root': <Application at >, 'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xb3cb688c>, 'traverse_subpath': [], 'user': <PloneUser 'Techniq'>, 'view': <Products.Five.metaclass.SimpleViewClass from /opt/Plone42/buildout-cache/eggs/plone.app.search-1.0.2-py2.7.egg/plone/app/search/search.pt object at 0xb4e4d08c>, 'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0xb2e706ac>} Module zope.tales.pythonexpr, line 59, in __call__ - __traceback_info__: ( view.breadcrumbs(item)) Module <string>, line 1, in <module> Module plone.app.search.browser, line 150, in breadcrumbs Module quills.app.browser.breadcrumbs, line 28, in breadcrumbs Module Products.CMFPlone.browser.navigation, line 256, in breadcrumbs Module Products.CMFPlone.browser.navigation, line 44, in get_view_url Module Products.CMFPlone.browser.navigation, line 28, in get_url AttributeError: 'NoneType' object has no attribute 'absolute_url'
comment:6 Changed 4 years ago by fsesser
Thanks for the patch!
I am updating a site from 2.1 to 4.2 and had items w/ missing Title attribute in my catalog. Live search worked, but extended search gave me the following stack trace. Applying the patch made "Extended Search" work again.
Traceback (innermost last): Module ZPublisher.Publish, line 126, in publish Module ZPublisher.mapply, line 77, in mapply Module ZPublisher.Publish, line 46, in call_object Module Products.Five.browser.metaconfigure, line 476, in __call__ Module Products.Five.browser.pagetemplatefile, line 125, in __call__ Module Products.Five.browser.pagetemplatefile, line 59, 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 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 225, in evaluateText Module zope.tales.tales, line 696, in evaluate URL: /srv/CoSe-Software/zope/gemeinde_42/Plone/buildout-cache/eggs/plone.app.search-1.0.2-py2.7.egg/plone/app/search/search.pt Line 157, Column 46 Expression: <PythonExpr ( portal_types.getTypeInfo(type).Title())> Names: {'args': (), 'container': <PloneSite at /gemeinde_1>, 'context': <PloneSite at /gemeinde_1>, 'default': <object object at 0x7fc1c9e57b30>, 'here': <PloneSite at /gemeinde_1>, 'loop': {}, 'nothing': None, 'options': {}, 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xe32d368>, 'request': <HTTPRequest, URL=http://neu.heroldsbach.de/@@search>, 'root': <Application at >, 'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7606fd0>, 'traverse_subpath': [], 'user': <PloneUser 'fsesser'>, 'view': <Products.Five.metaclass.SimpleViewClass from /srv/CoSe-Software/zope/gemeinde_42/Plone/buildout-cache/eggs/plone.app.search-1.0.2-py2.7.egg/plone/app/search/search.pt object at 0x151ece50>, 'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x15f6d5d0>} Module zope.tales.pythonexpr, line 59, in __call__ __traceback_info__: ( portal_types.getTypeInfo(type).Title()) Module <string>, line 1, in <module> AttributeError: 'NoneType' object has no attribute 'Title'
comment:9 Changed 3 years ago by mj
This looks like a Quills incompatibility to me. There is a bug report for Quills on the very same problem.
comment:10 follow-up: ↓ 11 Changed 3 years ago by kleist
But why the traceback in comment #2? Does Quill leave weird stuff behind after uninstall?
comment:11 in reply to: ↑ 10 Changed 3 years ago by mj
Replying to kleist:
But why the traceback in comment #2? Does Quill leave weird stuff behind after uninstall?
It looks as if there are still Quill blog posts in your site, and things now break because the type has been removed. The search page cannot find the type anymore in the types tool and that breaks. That may be a (separate) issue where the search page should just skip such items, but that is a edge case.
comment:12 Changed 3 years ago by mactrash
I am the guy who posted this issue to Quills bug report.
But this ERROR is very strange.
The error is for some wording (i.e. apple) when weblog is included in the search.
Can someone with good understand about the plone search to find some hits for resolve this issue?
Could you please try without the "Quills" add-on?