core icon indicating copy to clipboard operation
core copied to clipboard

[BUG] Rich Text Editor: Image source shifts to relative path on blur

Open adrianjm-dotCMS opened this issue 9 months ago • 2 comments

Problem Statement

There is a critical regression in the Rich Text content type. When a user interacts with an image within the editor (clicking to select or edit) and then clicks outside the editor area, the image src attribute is automatically transformed from an absolute path to a relative path.

  • Expected Source: /dA/9bf3ad75d5/dog 2.webp?language_id=1
  • Actual Source (after blur): ../dA/9bf3ad75d5/dog 2.webp?language_id=1

This silent mutation of the DOM breaks image rendering depending on the page's hierarchical depth.

https://github.com/user-attachments/assets/7e1a58d6-db8e-4190-9bf9-336ae5175f5a


Steps to Reproduce

  1. Navigate to a content entry using the Rich Text field or create a new one.
  2. Insert an image or edit existing content with an image using an absolute path.
  3. Click directly on the image inside the editor to focus it.
  4. Click anywhere outside the editor container (triggering the onBlur event).
  5. Inspect the HTML source/code view of the editor.
  6. Observe that the src attribute has been prepended with ../ and the image is broken.

Acceptance Criteria

  • [ ] URL Integrity: The src attribute must remain unchanged (absolute path) after the editor loses focus.
  • [ ] No Auto-Transformation: Disable any underlying library setting (e.g., TinyMCE, CKEditor) that converts URLs to relative paths.
  • [ ] Regression Testing: Verify that saving the content after this interaction does not persist the broken ../ path to the database.

dotCMS Version

dotcms-core 26.02.17-01 (February 17, 2026 12:46 PM)

Severity

Medium - Some functionality impacted

Links

https://dotcms.freshdesk.com/a/tickets/35698

adrianjm-dotCMS avatar Feb 27 '26 21:02 adrianjm-dotCMS

QA PASSED:

https://github.com/user-attachments/assets/0458d67d-dc29-4541-9080-8a2166bcd7d1

dario-daza avatar Apr 01 '26 21:04 dario-daza