Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collections preview fails in python 3 #2429

Closed
pbauer opened this issue May 23, 2018 · 2 comments
Closed

Collections preview fails in python 3 #2429

pbauer opened this issue May 23, 2018 · 2 comments
Assignees

Comments

@pbauer
Copy link
Member

pbauer commented May 23, 2018

The preview of collections fails since plone.app.contentlisting cannot adapt lists to IContentListingObject even though list is registered like this:

  <adapter
      factory=".contentlisting.ContentListing"
      for="list"
      />

The method ContentListing.__getitem__ is actually called in a template and the item in question is a list.

[12]   /Users/pbauer/workspace/plip/src/plone.app.querystring/plone/app/querystring/querybuilder.py(112)html_results()
-> )(**options)
[13]   /Users/pbauer/workspace/plip/src/plone.app.querystring/plone/app/querystring/querybuilder.py(38)__call__()
-> return self.index(**kw)
[14]   /Users/pbauer/workspace/plip/src/Zope/src/Products/Five/browser/pagetemplatefile.py(125)__call__()
-> return self.__func__(__self__, *args, **kw)
[15]   /Users/pbauer/workspace/plip/src/Zope/src/Products/Five/browser/pagetemplatefile.py(60)__call__()
-> sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
[16]   /Users/pbauer/.cache/buildout/eggs/zope.pagetemplate-4.3.0-py3.6.egg/zope/pagetemplate/pagetemplate.py(134)pt_render()
-> strictinsert=0, sourceAnnotations=sourceAnnotations
[17]   /Users/pbauer/workspace/plip/src/Zope/src/Products/PageTemplates/engine.py(85)__call__()
-> return self.template.render(**kwargs)
[18]   /Users/pbauer/.cache/buildout/eggs/z3c.pt-3.1.0-py3.6.egg/z3c/pt/pagetemplate.py(158)render()
-> return base_renderer(**context)
[19]   /Users/pbauer/workspace/plip/src/chameleon/src/chameleon/zpt/template.py(297)render()
-> return super(PageTemplate, self).render(**_kw)
[20]   /Users/pbauer/workspace/plip/src/chameleon/src/chameleon/template.py(171)render()
-> self._render(stream, econtext, rcontext)
[21]   /Users/pbauer/workspace/plip/84d83f2d4816870e860f7cdc1d8117a6.py(128)render()
[22] > /Users/pbauer/workspace/plip/src/plone.app.contentlisting/plone/app/contentlisting/contentlisting.py(30)__getitem__()
-> return IContentListingObject(self._basesequence[index])
(Pdb++) n
TypeError: ('Could not adapt', [<Products.ZCatalog.Catalog.Catalog.useBrains.<locals>.mybrains object at 0x109bb3ea0>, <Products.ZCatalog.Catalog.Catalog.useBrains.<locals>.mybrains object at 0x109bb32d0>, <Products.ZCatalog.Catalog.Catalog.useBrains.<locals>.mybrains object at 0x109bb3438>], <InterfaceClass plone.app.contentlisting.interfaces.IContentListingObject>)
(Pdb++) type(self._basesequence[index])
<class 'list'>
@davisagli davisagli self-assigned this Jun 25, 2018
@pbauer
Copy link
Member Author

pbauer commented Jun 25, 2018

Exposed in ./bin/test -s plone.portlet.collection -t test_exclude_context

@davisagli
Copy link
Member

Addressed in plone/plone.app.contentlisting#28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants