Support image fields with a default image

Created on 13 January 2023, over 1 year ago
Updated 14 July 2023, 11 months ago

Problem/Motivation

We have a content type that is consumed via json api into a Gatsby frontend. That content type has an image field. When you provide an image through the field, it shows up properly via jsonapi as you might expect. We then configured the image field to use a default image and alt text when an image is not provided through the "Default image" fieldset in the image field configuration. While this works properly when you view the content in Drupal, the default image data is not passed through jsonapi. Instead the image field data is null.

Steps to reproduce

1. Create a content type with an image field
2. Fill out the Default image fieldset in the image field settings.
3. Create a piece of content, do not supply an image.
4. View the content through jsonapi, observing that the data attribute for the image field is null.

Proposed resolution

I would expect the image data to be included in the image field output regardless of whether it is the default image or an image uploaded through the image field or provided by the field's default image settings.

πŸ’¬ Support request
Status

Closed: outdated

Version

9.4

Component
JSON APIΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¨πŸ‡¦Canada doana

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.69.0 2024