collective / collective.nitf

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

File content type breaks @@media view #201

Closed rodfersou closed 2 years ago

rodfersou commented 7 years ago
2017-05-30T11:49:23 ERROR Zope.SiteErrorLog 1496155763.010.654699821864 https://www.cartacapital.com.br/revista/954/a-canhoteira-de-pasadena/@@media
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 plone.autoform.view, line 47, in __call__
  Module plone.directives.dexterity.form, line 181, in render
  Module five.grok.components, line 130, in render
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module five.pt.engine, line 98, in __call__
  Module z3c.pt.pagetemplate, line 149, 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 2708061652d4e2f44ce617e9a04787fb, line 847, in render
  Module 82e049c16ef43e2c86566b51de877d68, line 1393, in render_master
  Module 82e049c16ef43e2c86566b51de877d68, line 613, in render_content
  Module 2708061652d4e2f44ce617e9a04787fb, line 835, in __fill_main
  Module 2708061652d4e2f44ce617e9a04787fb, line 105, in render_main
  Module 2708061652d4e2f44ce617e9a04787fb, line 444, in render_pic_sorter
AttributeError: 'NoneType' object has no attribute 'tag'

 - Expression: "python:scale.scale('image', scale='thumb').tag()" 
 - Filename:   ... .nitf-1.0b5-py2.7.egg/collective/nitf/templates/media.pt
 - Location:   (line 130: col 54)
 - Source:     ... ructure python:scale.scale('image', scale='thumb').tag()" />
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  repeat: {...} (0)
               template: <ViewPageTemplateFile - at 0x7f99e8fe7690>
               views: <ViewMapper - at 0x7f99c1b1aad0>
               modules: <instance - at 0x7f99f944fa70>
               args: <tuple - at 0x7f9a005bf050>                                                                                                                                                                                                                    
               here: <ImplicitAcquisitionWrapper a-canhoteira-de-pasadena at 0x7f99d1854460>                                                                                                                                                                        
               static: <DirectoryResource44 None at 0x7f99c1cf1790>
               user: <ImplicitAcquisitionWrapper - at 0x7f99d0ff0550>
               nothing: <NoneType - at 0x8fe4d0>
               container: <ImplicitAcquisitionWrapper a-canhoteira-de-pasadena at 0x7f99d1854460>
               request: <instance - at 0x7f99db03e5a8>
               wrapped_repeat: <SafeMapping - at 0x7f99d1be4db8>
               traverse_subpath: <list - at 0x7f99da7fb3f8>
               default: <object - at 0x7f9a004da520>
               context: <ImplicitAcquisitionWrapper a-canhoteira-de-pasadena at 0x7f99d1854460>
               view: <Media media at 0x7f99c1c0f510>
               translate: <function translate at 0x7f99d641d758>
               root: <ImplicitAcquisitionWrapper Zope at 0x7f99d11f3b90>
               options: {...} (0)
               loop: {...} (2)
               target_language: pt_BR
idgserpro commented 7 years ago

Not exactly the same error, but we had a similar issue but for a nitf without image in brasil.gov.tiles (https://github.com/plonegovbr/brasil.gov.tiles/issues/136).

hvelarde commented 7 years ago

@idgserpro please open a new issue and write a test to demonstrate it; let's focus on 2.x branch only for now.

idgserpro commented 7 years ago

Actually the problem is already solved.

wesleybl commented 2 years ago

I fixed media view in #255 .