collective / collective.nitf

A Dexterity-based content type inspired on the News Industry Text Format specification
8 stars 3 forks source link

Exception when syndicalize NITF #161

Closed rodfersou closed 8 years ago

rodfersou commented 8 years ago

When we enable to show content object body at @@syndication-settings the body of NITF objects the content is empty. Digging into, I found that there is an exception [silenced here], and when I take out the tal:on-error="nothing" this is what happens:

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 Products.CMFPlone.browser.syndication.views, line 112, 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 132, in pt_render
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  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 531, in do_optTag_tal
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: /srv/cache/eggs/Products.CMFPlone-4.3.9-py2.7.egg/Products/CMFPlone/browser/syndication/templates/newsml.xml.pt
   - Line 89, Column 24
   - Expression: <PathExpr standard:u'item/render_content_core'>
   - Names:
      {'args': (),
       'container': <Collection at /Plone/noticias/noticias>,
       'context': <Collection at /Plone/noticias/noticias>,
       'default': <object object at 0x7f2702581530>,
       'here': <Collection at /Plone/noticias/noticias>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7f26ed475100>,
       'request': <HTTPRequest, URL=http://localhost:8080/Plone/noticias/noticias/newsml.xml>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7f26ee34afd0>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <Products.Five.metaclass.SimpleViewClass from /srv/cache/eggs/Products.CMFPlone-4.3.9-py2.7.egg/Products/CMFPlone/browser/syndication/templates/newsml.xml.pt object at 0x7f26ee1236d0>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f26ed397810>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 155, in _eval
  Module Products.PageTemplates.Expressions, line 117, in render
  Module Products.CMFPlone.browser.syndication.adapters, line 239, in render_content_core
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
   - Warning: Macro expansion failed
   - Warning: <type 'exceptions.TypeError'>: 'BylineFeed' object is not iterable
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  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 867, in do_useMacro
  Module zope.tales.tales, line 696, in evaluate
   - URL: /srv/cache/eggs/Products.CMFPlone-4.3.9-py2.7.egg/Products/CMFPlone/browser/syndication/templates/content_core.pt
   - Line 2, Column 3
   - Expression: <PathExpr standard:u'here/?view/macros/content-core'>
   - Names:
      {'args': (),
       'container': <NITF at /Plone/noticias/praia-de-copacabana-ganha-campo-de-rugbi-para-o-publico>,
       'context': <NITF at /Plone/noticias/praia-de-copacabana-ganha-campo-de-rugbi-para-o-publico>,
       'default': <object object at 0x7f2702581530>,
       'here': <NITF at /Plone/noticias/praia-de-copacabana-ganha-campo-de-rugbi-para-o-publico>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7f26ed475b50>,
       'request': <HTTPRequest, URL=http://localhost:8080/Plone/noticias/noticias/newsml.xml>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7f26ee1234d0>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <collective.nitf.adapters.BylineFeed object at 0x7f26ed3abd10>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f26ed3abbd0>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 147, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 97, in trustedBoboAwareZopeTraverse
  Module zope.traversing.adapters, line 136, in traversePathElement
   - __traceback_info__: ({}, 'content-core')
  Module zope.traversing.adapters, line 50, in traverse
   - __traceback_info__: ({}, 'content-core', [])
LocationError: ({}, 'content-core')