I noticed this after drupal 9 update, but I've tried to find the exact moment when it was broken and I couldn't find it. I use S3 and cloudfront for images so maybe the problem is related with that config.

Apparently, the images work well (that's why I didn't realize it was broken). Images load correctly in my frontend and even the little preview in the backend is correctly shown. The problem is the link to the original file.

Backend aspect when uploading pictures

For instance, as you can see, the twitter image is working correctly (it's been shown in the backend) but if I follow the "twitter.jpg" link above the image, it sends me to:

<a href="/https%3A//test-web-development.s3.eu-west-1.amazonaws.com/s3fs-public/2022-01/twitter.jpg" type="image/jpeg">twitter.jpg</a>

The big problem is it's adding a "/" before the image link itself and instead of just using the url itself. On top of that, it's writing a "url-safe" so the "https://" is transformed into "htttps%3A//".

According to debug, it's using this template and I don't see anything strange in it (I tried a different theme too, but still failed):

<!-- BEGIN OUTPUT from 'core/themes/claro/templates/field/file-link.html.twig' -->

Any idea on what can be causing this?

  • Check S3/cloud front module, if that is doing a pre-processing
    – Sharique
    Jan 28 at 8:49

1 Answer 1


I think your issue is the same as the one described here: https://www.drupal.org/project/drupal/issues/3254553

It seems to be fixed now with this commit: https://git.drupalcode.org/project/drupal/-/commit/879b39ee5c5

If the Drupal core update will not help you, try to use some of the working patches in the issue thread temporary until Drupal core itself will not fix this issue for you.

  • Thanks a lot!!! It really seems the exact problem, but I think I'll wait until next patch release to install it :)
    – zapico
    Jan 28 at 12:39
  • I'm glad it helped ;)
    – zanvidmar
    Feb 2 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.