Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a User Card display with multiple fields, one of which is the 'user_picture.' In the 'manage display' tab, I selected the 'URL to image' format, which is supposed to provide the image link in the JSON output. However, this is not what is happening.
Please refer to the images below for illustration purposes.
Comment | File | Size | Author |
---|---|---|---|
#5 | Screenshot 2023-06-23 at 01.24.35.png | 134.83 KB | rfmarcelino |
#4 | 3367894_4.patch | 688 bytes | subhashuyadav |
#2 | Screenshot from 2023-06-21 14-59-43.png | 68.31 KB | Keshav Patel |
#2 | 3367894_2.patch | 1.4 KB | Keshav Patel |
FieldDrupal.png | 42.13 KB | Ricardocg |
Comments
Comment #2
Keshav Patel CreditAttribution: Keshav Patel at OpenSense Labs for DrupalFit commentedThe patch '3367894_2.patch' fixes the issue, now the output also contains the URI.
Comment #3
Keshav Patel CreditAttribution: Keshav Patel at OpenSense Labs for DrupalFit commentedComment #4
subhashuyadav CreditAttribution: subhashuyadav at Specbee commentedI guess #2 will only work for referenced fields. A direct call to file entity for example like `/ejson/file/{uuid}` will not render the uri value. Attaching the updated patch which handles both reference fields as well as direct call to file entity.
Comment #5
rfmarcelino CreditAttribution: rfmarcelino at Omibee commentedThank you @subhashuyadav and @Keshav Patel.
Committed with the URL instead of the URI and some extra file data (name, size, type)
Comment #6
rfmarcelino CreditAttribution: rfmarcelino at Omibee commented