Problem/Motivation

In Drupal 10, CKEditor 4 will be replaced with CKEditor 5. It can be tested following the steps on https://www.drupal.org/docs/core-modules-and-themes/core-modules/ckedito...

Autofloat is not compatible with CKEditor 5:
CKEditor 5 only works with HTML-based text formats. The "Float images alternately left and right" (filter_autofloat) filter implies this text format is not HTML anymore.

Steps to reproduce

  • Enable Autofloat.
  • Enable CKEditor 5 module.
  • Configure the Basic HTML format by enabling "Float images alternately left and right." and save.
  • Configure it again by selecting "CKEditor 5" instead of "CKEditor": the above error message is displayed and the new configuration cannot be saved.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

ifrik created an issue. See original summary.

lolandese’s picture

Thanks for the link. Useful.

See more in Everything you need to know about CKEditor 5 integration for Drupal 9 - QED42 to see Ways of integrating CKEditor5.

Any patch, further guidance or help is appreciated.

lolandese’s picture

https://freelance-drupal.com/en/blog/testing-ckeditor-4-to-5-upgrade-path suggests to change in autofloat/src/Plugin/Filter/AutoFloat.php

 *   type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE,

with:

 *   type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,

To roll a patch and test.

lolandese’s picture

Status: Active » Needs review
StatusFileSize
new537 bytes

As suggested by #3.

  • lolandese committed 90e2c0d on 8.x-1.x
    Issue #3274048 by lolandese: CKEditor 5 compatability
    
lolandese’s picture

Status: Needs review » Fixed
StatusFileSize
new451.04 KB
new321.07 KB

The patch solves the issue. Tested following the steps as suggested by the OP in the issue description. See screenshots:

Click to enlarge

Click to enlarge

lolandese’s picture

A dev release is now available for Drupal 10:
https://www.drupal.org/project/autofloat/releases/2.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.