collective / collective.nitf

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

AttributeError is rised on collection tile when news article has no lead image #178

Closed hvelarde closed 8 years ago

hvelarde commented 8 years ago
2016-10-31T16:24:03 ERROR plone.subrequest Error handling subrequest to http://localhost:8181/Plone/bessinha/bessinha/@@collective.cover.collection/f42e1ad40de94218bc37
a1493de4ccac
Traceback (most recent call last):
  File "/home/example/my-example/eggs/plone.subrequest-1.6.9-py2.7.egg/plone/subrequest/__init__.py", line 136, in subrequest
    bind=1)
  File "/home/example/my-example/eggs/Zope2-2.13.22-py2.7.egg/ZPublisher/mapply.py", line 78, in mapply
    else: return object(*args)
  File "/home/example/my-example/eggs/plone.tiles-1.4.0-py2.7.egg/plone/tiles/esi.py", line 59, in __call__
    return self.index(*args, **kwargs)
...
  File "/home/example/my-example/eggs/zope.tales-3.5.3-py2.7.egg/zope/tales/pythonexpr.py", line 59, in __call__
    return eval(self._code, vars)
  File "<string>", line 1, in <module>
  File "/home/example/my-example/eggs/collective.cover-1.0a11-py2.7.egg/collective/cover/tiles/collection.py", line 203, in thumbnail
    return scales.scale('image', scale)
  File "/home/example/my-example/eggs/collective.nitf-2.0b3-py2.7.egg/collective/nitf/browser/scaling.py", line 38, in scale
    scales = image.restrictedTraverse('@@images')
AttributeError: 'NoneType' object has no attribute 'restrictedTraverse'
idgserpro commented 8 years ago

maybe this will help: https://github.com/plonegovbr/brasil.gov.portlets/commit/9b66a14e89291e7aacc29925216e72e635c2cf2e

rodfersou commented 8 years ago

@idgserpro I'm doing the same as collection summary_view in my fix, and making it work just changing the template of tile collection.