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:
For an image file this is not working because empty will never be true. Instead the error property has to be checked:
Hope this information is helpful for future versions.
Patrick
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 |
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!