In an Image Gallery, if there is an Image document in which no image file has been stored (field name is preview), the view page of Image Gallery is broken (layout_image_gallery_view). One gets the Zope auth popup.
Extract from traceback info:
URL: file:CPSDocument/skins/cps_document/layout_imagegallery_view.pt
Line 49, Column 10
Expression: <PythonExpr here.getImgTag( item.absolute_url_path()+'/preview',
(...)
* Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
__traceback_info__: here.getImgTag( item.absolute_url_path()+'/preview', base_url='',width=th_width,height=th_height, keep_ratio=1, img=item.restrictedTraverse('preview'))
* Module Python expression "here.getImgTag( item.absolute_url_path()+'/preview', base_url='',width=th_width,height=th_height, keep_ratio=1, img=item.restrictedTraverse('preview'))", line 1, in <expression>
* Module OFS.Traversable, line 250, in restrictedTraverse
* Module OFS.Traversable, line 218, in unrestrictedTraverse
__traceback_info__: ([], 'preview')
Indeed, it seems that a protection against None is missing somewhere.
Also, the image file is not mandatory in Image doc type (will change that in my specific project)