Resizing non-uploaded image caused fatal error

1 view
Skip to first unread message

Alexander Obuhovich

unread,
Sep 13, 2012, 7:00:35 AM9/13/12
to Bugs In-Portal
When image upload isn't required then this means that there are no 100% guarantee that image will be there.

For such cases in template, where image will be displayed we:
  • either display default image, e.g. <inp2:unit-prefix_Field name="ImageField" format="resize:100x100;default:img/no_image.gif"/>
  • or place <inp2:m_if check="unit-prefix_Field" name="ImageField" db="db"> ... </inp2:m_if> around image display code
If none of mentioned above happens then horrible fatal error happens, that results in "The connection was reset" message being returned from a web server with no idea about what caused it.



Ready for testing.


--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com
missing_image_results_in_fatal_error.patch
Reply all
Reply to author
Forward
0 new messages