Views is returning empty captions.

Created on 7 March 2017, almost 8 years ago
Updated 22 January 2024, 11 months ago

Recently I have noticed captions I pull in through Views 7.x.3.15 are empty. When putting the query in PHPMyAdmin, the value for the captions are NULL.

Here is an example query below:

SELECT field_image_field_image_field_caption.caption AS field_image_field_image_field_caption_caption, node.created AS node_created
FROM
{node} node
LEFT JOIN {field_data_field_image} field_data_field_image ON node.nid = field_data_field_image.entity_id AND (field_data_field_image.entity_type = 'node' AND field_data_field_image.deleted = '0')
LEFT JOIN {field_image_field_caption} field_image_field_image_field_caption ON field_data_field_image.entity_id = field_image_field_image_field_caption.entity_id AND field_data_field_image.delta = field_image_field_image_field_caption.delta AND (field_image_field_image_field_caption.entity_type = 'node' AND field_image_field_image_field_caption.field_name = '0')
WHERE (( (node.status = '1') AND (node.type IN ('story')) ))
ORDER BY node_created DESC
LIMIT 5 OFFSET 0

In the example above, I bolded the left join condition that I think is problematic. With the condition checking for the value '0' instead of the field machine name, it returns NULL values for captions. If I replace '0' with 'field_image' (the field machine name), it works.

Any ideas why this is happening?

I am on core 7.54

Thanks!

πŸ› Bug report
Status

Closed: outdated

Version

2.1

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States philbNV

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024