Add option absolute url in formatter URL to image

Created on 19 March 2019, over 5 years ago
Updated 11 March 2024, 4 months ago

Issue summary updated as of comment #17

Problem/Motivation

Image field formatter URL of image needs option Absolute URL.
Usage:
- Display full image URL on page.
- Image field URL in Views data export (XML, CSV).

Steps to reproduce

Add Image field to content.
Alter field options to enable Use absolute URL.

User interface changes

✨ Feature request
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
Image systemΒ  β†’

Last updated 1 day ago

Created by

πŸ‡ΉπŸ‡³Tunisia Riadh Rahmi

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.

  • πŸ‡ΊπŸ‡ΈUnited States jcmartinez Raleigh, NC, USA

    Tested patch #28 on a site.

    The full path doesn't show on a views.

    To reproduce:

    • Add a display to a media type that contains an image media field. I called mine "Full URL"
    • Set the format of the field "URL to Image".
    • Click the cogwheel and check the "Use absolute link". Select one image style and hit "Update" and "Save"
    • Create a view for the content type that uses this media.
    • Add the media field.
    • Set Formatter = Rendered entity
    • Set View mode = the same you create. In my case "Full URL"

    The result is that the field still shows a relative path.

  • Status changed to Needs review 12 months ago
  • last update 12 months ago
    29,811 pass
  • πŸ‡©πŸ‡ͺGermany mrshowerman Munich

    The new field was missing in the schema. The new checkbox is now below the image style selection.
    I brought back the tests (see #30) and added a test for the new option.

    Didn't look into #31 yet. I also agree with #30.2 but I guess that should be handled in another issue.

  • Status changed to Needs work 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    So with the new schema it will need an upgrade path for existing sites.

  • Status changed to Needs review 12 months ago
  • last update 12 months ago
    29,811 pass
  • πŸ‡©πŸ‡ͺGermany mrshowerman Munich

    Here it is.

  • Status changed to Needs work 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Tested the post_update hook and ran without issues
    On a standard profile install reused the Article content type and changed Image field to be URL to image
    Saw new setting and confirmed it worked as expected.

    Will need a change record for the new setting. Nice to have before/after examples in it too.

    Thanks!

  • Status changed to Needs review 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States angrytoast Princeton, NJ

    This is exactly the change we needed for exposing image field data to external API consumers. Thanks to all who have contributed!

    I took a first stab at a change record using a REST json output as the example. Hopefully that is sufficient and helps this one get merged.

    https://www.drupal.org/node/3408945 β†’

  • Status changed to RTBC 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Believe the CR should be good.

    Cleaning up patches for clarity.

    Reverified that the post_update hook runs without issue.
    Verified that the new setting is appearing.

    Test coverage follows the existing pattern for testing image formatters so seems good.

  • last update 6 months ago
    30,764 pass
  • last update 6 months ago
    30,766 pass
  • πŸ‡ΊπŸ‡ΈUnited States angrytoast Princeton, NJ

    Just came across https://www.drupal.org/project/drupal/issues/2811043 ✨ File formatter render absolute url to file Needs work (File formatter render absolute url to file) which looks like a more complete solution that includes both file + image absolute link options, tests, and cache context considerations.

    We should focus on getting that issue merged instead as it is more complete?

  • Status changed to Needs review 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    If this should be closed as a dup

  • Status changed to Closed: duplicate 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    More I look at it I agree this is probably a duplicate, going to close this one out.

  • πŸ‡²πŸ‡©Moldova ion.eftodii

    ion.eftodii β†’ changed the visibility of the branch 9.5.x to active.

Production build 0.69.0 2024