image empty check not working properly in generated view.php

Permalink Browser Info Environment
There is a bug I found, that I'd like to share here:
In a generated view.php a check is performed if an atrribute exists before it is outputted:
<?php  if (!empty($field_5_text)): ?>

For an image file this is not working because empty will never be true. Instead the error property has to be checked:
<?php  if (!$field_4_file->error): ?>

Hope this information is helpful for future versions.

Patrick

Type: Discussion
Status: New
PatrickHeck
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Hi Patrick,
Thanks for posting this. I just went through the same problem with file downloads, and never thought to apply that fix to images as well -- d'oh!
jordanlev replied on at Permalink Reply
jordanlev
I've just upgraded Designer Content to version 2.1.3, which addresses this problem (and a few other things as well).

Thanks again for letting me know about this!

-Jordan

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.