Blank Images when maximum number set
surge_martin - November 2, 2009 - 19:53
| Project: | ImageField |
| Version: | 6.x-3.2 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I have an imagefield configured to accept a maximum of six images. When six images are uploaded it works perfectly, but if only five are uploaded it creates an additional, blank listing for the sixth. I would expect that in such a case it would only list entries which actually contain an image.

#1
ImageField is not responsible for this behavior. This is the way CCK behaves for all multi-value fields, regardless of if they are image or text fields. If you'd like to not include the empty items in your presentation, I'd suggest theming your nodes so that empty rows do not show up.
#2
Er, wait are saying it actually creates
<img>tags that don't point to any actual files? Perhaps a screenshot or a code sample of your HTML would help clarify.#3
Sorry, I forgot that I was doing some custom processing to put the image in as a CSS background. It still seems odd to me that it wouldn't just omit empty values, but it was easy enough to just add a check to my processing loop.
Thanks for the quick response.