Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When the item is empty ('fid' = 0) and arrives to the formatter function, it first tries to load the default and then it formats it. However, there might no default as well and it tries to format it anyway generating, for instance, and empty img referece.
Same applies to imagefield, I will place the same patch for it on the project's issues.
Comment | File | Size | Author |
---|---|---|---|
#6 | imagecache.module.patch | 486 bytes | hanoii |
imagecache.module.patch | 485 bytes | hanoii |
Comments
Comment #1
hanoiiRelated to same bug in imagefield #260672: Imagefield field formatter is generating broken output when no actual image (or default) is available.
Comment #2
alippai CreditAttribution: alippai commentedSimple, clear patch... tested...
Comment #3
ar-jan CreditAttribution: ar-jan commentedWorks, great!
It was quite annoying to have an 'f' show up for empty fields in a View.
Comment #4
masande CreditAttribution: masande commentedi was going to suggest a similar patch until i finally found this one. tested and works as intended.
Comment #5
fairwind@drupal.ru CreditAttribution: fairwind@drupal.ru commented$item['fid'] is empty even if default image is set (leading to no default image). it's better to check $item['filename']
Comment #6
hanoii@fairwind: Right, another problem on imagefield #310047: Field is not removed from shared content_field_XXX table on delete just led me to this issue once more and you're right about using 'filepath' for the if condition.
Attached is the new patch against new version of imagecache.
Comment #7
drewish CreditAttribution: drewish commentedthanks, committed to HEAD.
Comment #8
drewish CreditAttribution: drewish commentedmarked #300549: hook_field_formatter, theme_imagecache as a duplicate
Comment #9
drewish CreditAttribution: drewish commentedmarked #280367: Don't imagecache_field_formatter() a non existent image as a duplicate
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.