Allow absolute URLs to be generated using the editor_file_reference filter

Created on 15 May 2024, 6 months ago
Updated 23 July 2024, 4 months ago

Problem/Motivation

Hello. When using markup obtained via the API from fields like text_*, there is a problem in displaying embedded images due to the fact that they have a relative path and this makes their use on decoupled sites difficult.

This problem is also aggravated on sites that use different streams in different editors, for example s3fs, public and others. In such cases, setting a domain for relative links comes with various conditions.

But naive processing that makes all links absolute is not always desirable. Decoupled sites can also rely on setting relative links, and setting a backend domain for all links may break them.

In order not to solve this problem every time at the project level, I suggest adding this option to the kernel, since the kernel already handles file references in the editor_file_reference filter, you just need to add the configuration for the createFileUrl method parameter.

Steps to reproduce

Proposed resolution

Add a setting to the editor_file_reference filter to convert URLs to absolute ones.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
EditorΒ  β†’

Last updated about 6 hours ago

Created by

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs product manager review

    It is used to alert the product manager core committer(s) that an issue represents a significant new feature, UI change, or change to the "user experience" of Drupal, and their signoff is needed. If an issue significantly affects the usability of Drupal, use Needs usability review instead (see the governance policy draft for more information).

  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024