I've tried to create image galleries using Views in D7, and none of them have worked because the images simply don't show up. BUT the correct number of entries are shown (as I'm also displaying Title while trying to debug this problem), so I think the Views query is almost right but not quite.
My content type is called "Image Gallery" and I add one custom field called "photo" which can have unlimited entries. When I view the built-in page, things look fine and I can adjust the image sizes using "manage displays" so I know the problem must be with Views. Within Views I am merely filtering by this content type, then for Fields I am showing Node:Title and Fields:field_photo - I am formatting the field merely to output the original image (also tried the various imagecache formats). The query returns the correct number of entries because the Title appears multiple times, but no images show up. I looked at the query then at my DB, and while I know next to nothing about the inner workings of Views, I think it is because Views never consults the "file_managed" table even though that's where the URL's are for the uploaded files.
Here is the query in Views:
SELECT node.title AS node_title, node.nid AS nid, field_data_field_photo.entity_id AS field_data_field_photo_entity_id, field_data_field_photo.etid AS field_data_field_photo_etid, field_data_field_photo.delta AS field_data_field_photo_delta, field_data_field_photo.language AS field_data_field_photo_language, field_data_field_photo.field_photo_fid AS field_data_field_photo_field_photo_fid, field_data_field_photo.field_photo_alt AS field_data_field_photo_field_photo_alt, field_data_field_photo.field_photo_title AS field_data_field_photo_field_photo_title, field_data_field_photo.revision_id AS field_data_field_photo_revision_id, field_data_field_photo.bundle AS field_data_field_photo_bundle
FROM
{node} node
LEFT JOIN {field_data_field_photo} field_data_field_photo ON node.nid = field_data_field_photo.entity_id AND (field_data_field_photo.etid = :views_join_condition_0 AND field_data_field_photo.deleted = :views_join_condition_1)
WHERE (( (node.type IN ('image_gallery')) AND (node.status = '1') ))
LIMIT 12 OFFSET 0
Here's a similar query in one of my D6 sites:
SELECT node.nid AS nid,
node_data_field_gallery_image.field_gallery_image_fid AS node_data_field_gallery_image_field_gallery_image_fid,
node_data_field_gallery_image.field_gallery_image_list AS node_data_field_gallery_image_field_gallery_image_list,
node_data_field_gallery_image.field_gallery_image_data AS node_data_field_gallery_image_field_gallery_image_data,
node_data_field_gallery_image.delta AS node_data_field_gallery_image_delta,
node.type AS node_type,
node.vid AS node_vid
FROM node node
LEFT JOIN content_field_gallery_image node_data_field_gallery_image ON node.vid = node_data_field_gallery_image.vid
WHERE (node.status <> 0) AND (node.type in ('imagegallery'))
This query is pretty similar except for the bracketed terms {node} and {field_data_field_photo} which are only in the D7 query (and cause it to be invalid when entering it directly on the DB). Also the :views_join_condition thingies are new in D7...
Comments
Comment #1
greg606 commentedCan be duplicate of #987478: Field language is not properly handled
Comment #2
dawehnerIsn't this a duplicate of #987478: Field language is not properly handled
Sadly i have to idea how to reproduce it. It works fine here.
Comment #3
RumpledElf commentedI have a feeling I have the same issue.
I have a view that I'm trying to show three text fields and taxonomy terms for a particular content type, but for some reason only two fields show - the rest come up blank. I got the lastest dev of d7 and views and everything and all that changed is a different two fields showed, the rest came up blank. Reordering the fields or just clicking around in views can also change which two fields show.
I'm completely at a loss, and this renders views utterly unuseable for me.
Comment #4
bojanz commentedWe tested quite extensively the latest -dev changes to try and fix all the "field doesn't show" bugs.
It's possible that we missed one.
Can you please provide a Feature (exported view, content type, fields)?
As a start, a screenshot of a devel load (of the node whose fields are not completely displayed) might help.
Comment #5
bojanz commentedLooks like the problem is no longer present.
Reopen if I'm wrong.