Changes to a block's text field not saved when ckeditor source mode is active

Created on 19 November 2019, about 5 years ago
Updated 10 July 2024, 5 months ago

Problem/Motivation

On a layout builder page I am seeing data loss when saving an existing block with source mode enabled in ckeditor. At least the data loss is quite obvious ;)

Steps to reproduce:

  • Add block to section
  • Create custom block
  • Edit text in body field
  • Save block
  • Edit block
  • Switch body field to ckeditor source mode
  • Edit text
  • Save
  • Changes are NOT saved!

Workaround: Once I change back to non-source mode and do some change(!) the changes are saved properly.

Variation

This is a bit more severe with ckeditor_config β†’ (on a core 8.7.8 install with a lot modules installed) module enabled.

Steps to reproduce:

  • Add startupMode = source to ckeditor_config settings in basic_html
  • Edit block
  • Switch body field to source mode
  • Edit text
  • Switch to non-source mode (this makes it work in the first example)
  • Save
  • Changes are NOT saved!

(Disclaimer: In the variation I am not 100% sure if it is because of the mentioned ckeditor_config settings, at least I haven't verified on a vanilla drupal install)

Proposed resolution

Allow textarea fields to be saved when edited in CKEditor 4's Source mode.

Remaining tasks

  1. Valid and remediate issue between patches in #26 and #29.
  2. Write valid tests confirming issue has been resolved.
πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany anruether Bonn

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.

  • JavaScript

    Affects the content, performance, or handling of Javascript.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

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.

Production build 0.71.5 2024