Provide migration path for colorbutton configuration

Created on 26 August 2022, over 2 years ago
Updated 26 December 2023, over 1 year ago

Problem/Motivation

As of right now, there exists no configuration migration for colorbutton configurations over to ckeditor_font. Let's make that happen so the migration process to CKE5 is as smooth as possible.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Webbeh Georgia, USA

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • I have prepared a PR with the following changes
    - FontSizeAndFamily plugin update for "colorbutton" migration
    - updating FontBackgroundColor and FontColor plugins so that default colors are used when empty settings (behavior from "colorbutton")

    Here is the patch with these changes

  • Status changed to Needs review over 1 year ago
  • πŸ‡³πŸ‡΄Norway magnarmartinsen

    Hi. I tried the upgrade from CkEditor4 to CkEdtior 5, with colorbutton and preconfigured colors.
    The site is running Drupal 10.2.1. During the upgrade from CkEditor4 to CkEditor 5 using ckeditor_font:2.0.x-dev with the 3306246-4.patch.

    However I get an error and the upgrade fails with message:
    "

    Error message
    Oops, something went wrong. Check your browser's developer console for more details.

    "

    In the logs i find the following error:
    AssertionError: assert(count($cke5_plugin_settings) === 1) in assert() (line 484 of /var/www/html/web/core/modules/ckeditor5/src/SmartDefaultSettings.php).

    Adding some debug before the assertion test before line 484 in web/core/modules/ckeditor5/src/SmartDefaultSettings.php, gives me:

    $cke4_plugin_id="colorbutton"
    and

    $cke5_plugin_settings=Array
    (
        [ckeditor_font_font_color] => Array
            (
                [font_colors] => #474994
    #E7B059
    #E8BBBA
    #A0CCCB
    #ff0000
            )
    
        [ckeditor_font_font_background_color] => Array
            (
                [font_backgroundcolors] => #474994
    #E7B059
    #E8BBBA
    #A0CCCB
    #ff0000
            )
    
    )
  • First commit to issue fork.
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    I refactored this a bit and I was able to migrate the font size and families, there's still some work to do with the colours, but I believe this can be merged to the 2.0.x branch for now. I'll deal with the colours later, screens below:

    Screenshot of CKEditor 4:

    Screenshot of CKEditor 5 after the migration:

  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    I'll move this to "Fixed" for now, if anyone is still having problems with migrating the fonts family and font sizes to CK5, please let me know and I'll re-open the task.

    Thanks a lot to everyone involved.

    Also please not that this module might be deprecated #3456411: Deprecate in favor of the CKEditor 5 Plugin Pack β†’

  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024