Broken file links when using CDN or a remote stream

Created on 10 May 2023, over 1 year ago
Updated 12 October 2023, about 1 year ago

Problem/Motivation

When using an external File System such as Amazon S3 or Azure Blob the file links are broken. The link is always relative instead of an Absolute URL.

Steps to reproduce

Use the Media button to include a link when the files are provided from an external source. The links will be pointing always to the main domain URL instead of the CDN URL.

Proposed resolution

Fix the way the URL to the file is returned. Currently on the CKEditorEntityLinkDialog.php at line 228 the URL is returned using a parse_url() that removes the domain. See https://git.drupalcode.org/project/ckeditor_entity_link/-/blob/8.x-1.3/s....

Also, it is using a deprecated function file_create_url(), the recommended solution, is to use the FileUrlGenerator, this class will return the correct URL for a local file system or an absolute URL when using a CDN or other service.

🐛 Bug report
Status

Needs review

Version

1.3

Component

Code

Created by

🇧🇷Brazil adrianopulz Florianópolis

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

Comments & Activities

Production build 0.71.5 2024