isawnyu / pleiades-kml

1 stars 1 forks source link

KML generation through the plone is not tolerant of null "attested" forms of names #2

Open paregorios opened 10 years ago

paregorios commented 10 years ago

Traceback:

  Module zope.tales.tales, line 696, in evaluate
   - URL: kml_document
   - Line 39, Column 6
   - Expression: <PathExpr standard:u'folder/appellations'>
   - Names:
      {'container': <Place at /plone/places/857018>,
       'context': <Place at /plone/places/857018>,
       'default': <object object at 0xb74e5528>,
       'here': <Place at /plone/places/857018>,
       'loop': {u'folder': <Products.PageTemplates.Expressions.PathIterator object at 0xe2b7dec>},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xe2b736c>,
       'request': <HTTPRequest, URL=http://pleiades.stoa.org/places/857018/kml>,
       'root': <Application at >,
       'template': <ImplicitAcquirerWrapper object at 0xe2b70ac>,
       'traverse_subpath': [],
       'user': <SpecialUser 'Anonymous User'>,
       'view': <Products.Five.metaclass.PlaceDocument object at 0xe2b748c>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0xe2b758c>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 155, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 105, in trustedBoboAwareZopeTraverse
  Module zope.traversing.adapters, line 164, in traversePathElement
   - __traceback_info__: (<pleiades.kml.browser.PlaceFolder object at 0xe2b714c>, 'appellations')
  Module zope.traversing.adapters, line 44, in traverse
   - __traceback_info__: (<pleiades.kml.browser.PlaceFolder object at 0xe2b714c>, 'appellations', [])
  Module pleiades.kml.browser, line 254, in appellations
TypeError: sequence expected, generator found
paregorios commented 10 years ago

Here's the point in the code: https://github.com/isawnyu/pleiades-kml/blob/master/pleiades/kml/browser.py#L254

paregorios commented 10 years ago

Tried wrapping the expression inside join() with list(), but this just exposed the fact that o.getNameAttested() is returning nulls for names added in the TAVO/GANE load that don't have a value in the attestedName field. Example traceback still to be added. Ran out of time to finish documenting, will do more later.