As per Obtaining support for Views issues I'm reporting this bug here
I have a content type with an ImageField where up to 5 images can be uploaded. Not all nodes contain five images.
For this content type, the final, last, image is the most interesting one. However, the order is important and I cannot change that.
In a Table View I selected the field "Content: image table-size image" (an ImageCache preset) to group multiple values, and choose to display only one value. And I checked reversed, to get the last image in the table.
Only now, the table shows the field's empty marker for each node that has less than 5 images. Safe to assume that Views is looking at the last value all the time.
I'm not sure if ImageField/FileField put anything in the field when supposed empty, or if Views errs by returning knowingly empty fields.
Feel free to kick this issue into the views queue if needed
Comments
Comment #1
quicksketchThis is actually most related to CCK than ImageField or Views, since it provides the Views integration for ImageField (yes, confusing I know). The problem you're seeing is that if you manually set a number of fields (such as 5), then CCK will always enter 5 rows into the database, even if the value of some of those rows is NULL. I'd suggest that you look into doing some custom theming on your view, I'm not sure what other solution would work for you.
Comment #2
eiland commentedHm, are you sure?
I would really think this is a views issue, as the view doesn't recognize the empty value
Now I made a grid of images, and every node which has less then five images gives me empty spots... a bit like amnesia...
Bon, I made a new contenttype with Integer and text values, allowing 3 values per node, and just giving two.
Created a view with a table which will only show the last one or two values. The same amnesia occurs. So hereby I think its a view issue.... or oh no, maybe still CCK....
Pushing it to CCK queue...
Comment #3
eiland commentedWhen I change from a limited to a unlimited imagefield, it doesnt add empty value. Now I need only to resave all my items to remove the automatically added empty fields...