Posted by hanoii on May 20, 2008 at 2:41pm
6 followers
| Project: | ImageCache |
| Version: | 5.x-2.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| imagecache.module.patch | 485 bytes | Ignored: Check issue status. | None | None |
Comments
#1
Related to same bug in imagefield #260672: Imagefield field formatter is generating broken output when no actual image (or default) is available.
#2
Simple, clear patch... tested...
#3
Works, great!
It was quite annoying to have an 'f' show up for empty fields in a View.
#4
i was going to suggest a similar patch until i finally found this one. tested and works as intended.
#5
$item['fid'] is empty even if default image is set (leading to no default image). it's better to check $item['filename']
#6
@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.
#7
thanks, committed to HEAD.
#8
marked #300549: hook_field_formatter, theme_imagecache as a duplicate
#9
marked #280367: Don't imagecache_field_formatter() a non existent image as a duplicate
#10
Automatically closed -- issue fixed for two weeks with no activity.