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.

CommentFileSizeAuthor
#6 imagecache.module.patch486 byteshanoii
imagecache.module.patch485 byteshanoii
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hanoii’s picture

alippai’s picture

Status: Needs review » Reviewed & tested by the community

Simple, clear patch... tested...

ar-jan’s picture

Works, great!
It was quite annoying to have an 'f' show up for empty fields in a View.

masande’s picture

i was going to suggest a similar patch until i finally found this one. tested and works as intended.

fairwind@drupal.ru’s picture

$item['fid'] is empty even if default image is set (leading to no default image). it's better to check $item['filename']

hanoii’s picture

Version: 5.x-2.0 » 5.x-2.1
FileSize
486 bytes

@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.

drewish’s picture

Status: Reviewed & tested by the community » Fixed

thanks, committed to HEAD.

drewish’s picture

drewish’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.