I am trying to do what I did before to make it work in Plone 4. I am TTW customizing the template plone.dexterity.interfaces.idexteritycontainer-listing_view. I copied it to the folder I want this behaviour.
I edited the line
<tal:results define="batch view/batch">
and changed it to:
<tal:results define="batch python:context.othersite.portal_catalog.searchResults({'portal_type': 'News Item', 'review_state': 'published'});">
This worked before. Instead of rendering the content of the folder, it would return this search that uses traverse to get content from othersite.
When the query return empty I get no error, just an empty space.
When the query returns something, I get the following traceback. Can someone help me with this? Is this a permission problem?:
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module five.customerize.zpt, line 83, in __call__
Module Products.PageTemplates.ZopePageTemplate, line 338, in _exec
Module Products.PageTemplates.ZopePageTemplate, line 435, in pt_render
Module Products.PageTemplates.PageTemplate, line 87, in pt_render
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module five.pt.engine, line 98, in __call__
Module z3c.pt.pagetemplate, line 163, in render
Module chameleon.zpt.template, line 261, in render
Module chameleon.template, line 191, in render
Module chameleon.template, line 171, in render
Module 6f2dfff5e8f3e18631d996f2463a2b0d.py, line 1651, in render
Module 64de3a14df28dbc69b12f555c12ec8dd.py, line 1223, in render_master
Module 64de3a14df28dbc69b12f555c12ec8dd.py, line 420, in render_content
Module 6f2dfff5e8f3e18631d996f2463a2b0d.py, line 1639, in __fill_content_core
Module 6f2dfff5e8f3e18631d996f2463a2b0d.py, line 440, in render_content_core
Module 6f2dfff5e8f3e18631d996f2463a2b0d.py, line 293, in render_listing
Module 6f2dfff5e8f3e18631d996f2463a2b0d.py, line 1339, in render_entries
Module five.pt.expressions, line 135, in __call__
Module five.pt.expressions, line 126, in traverse
Module zope.traversing.adapters, line 136, in traversePathElement
__traceback_info__: (<Products.ZCatalog.Catalog.mybrains object at 0x7fcea75d8328>, 'PortalType')
Module zope.traversing.adapters, line 50, in traverse
__traceback_info__: (<Products.ZCatalog.Catalog.mybrains object at 0x7fcea75d8328>, 'PortalType', ())
LocationError: (<Products.ZCatalog.Catalog.mybrains object at 0x7fcea75d8328>, 'PortalType')
- Expression: "item/PortalType"
- Filename: ... ne.dexterity.interfaces.idexteritycontainer-listing_view
- Location: (line 31: col 21)
- Arguments: repeat: {...} (0)
template: <ImplicitAcquisitionWrapper plone.dexterity.interfaces.idexteritycontainer-listing_view at 0x7fcea7512d20>
modules: <instance - at 0x7fcf15ba4170>
here: <ImplicitAcquisitionWrapper orgao-central at 0x7fcea7512820>
user: <ImplicitAcquisitionWrapper - at 0x7fcea75124b0>
nothing: <NoneType - at 0x7ac030>
target_language: <NoneType - at 0x7ac030>
container: <ImplicitAcquisitionWrapper orgao-central at 0x7fcea7512820>
default: <object - at 0x7fcf202ddc50>
request: <instance - at 0x7fcef9a34758>
wrapped_repeat: <SafeMapping - at 0x7fcea761fe68>
loop: {...} (1)
context: <ImplicitAcquisitionWrapper orgao-central at 0x7fcea7512820>
translate: <function translate at 0x7fcedd173398>
root: <ImplicitAcquisitionWrapper Zope at 0x7fcebdaaa500>
options: {...} (1)
view: <TTWView None at 0x7fcea758b8d0>