CkEditor 5 colorplateicon console error

Created on 11 July 2024, 4 months ago
Updated 12 September 2024, 2 months ago

I have added colors to the font color in the ckeditor 5 text formats now i am trying to apply it to the fonts in the ui but it giving error in the consloe when i click the colorplate icon it gives error help me with this issue as soon as possible

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇵🇰Pakistan Danyal zeb

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

Merge Requests

Comments & Activities

  • Issue created by @Danyal zeb
  • 🇵🇱Poland Pozi

    Hello i had the same problem i could not open font color and font background menus. I noticed that some extra code was copied from external editor:

    After applying "Remove Format" on this fragment of text both menus have returned to operation.

  • 🇵🇰Pakistan Danyal zeb

    Pozi can you explian how to apply remove format on ckeditor 5
    i am using full html text for my sections

  • 🇨🇦Canada jmfama

    Ran into this too. Issue is related to some bad minimization.

    In js/build/font.js:
    icon:i.icons.colorPaletteIcon

    should be changed to:
    icon:e.icons.colorPaletteIcon

  • First commit to issue fork.
  • i'm trying to override the js/fuild/font.js to update icon:i.icons.colorPaletteIcon to icon:e.icons.colorPaletteIcon like this but not working

    libraries-override:
      ckeditor5_font/ckeditor5_font:
        js:
          js/build/font.js: assets/js/font.js
    
  • 🇵🇰Pakistan Allahnoor Turab

    Yes #5 looks like minimization issue, because there is no variable with this name in the repo of this file.

    For quick solution we can override the js file with as per #5 using hook.

    /**
     * Implements hook_library_info_alter().
     */
    function miscellaneous_library_info_alter(array &$libraries, $extension) {
      // Check if we're altering the 'ckeditor5_font' module's library.
      if ($extension === 'ckeditor5_font' && isset($libraries['ckeditor5_font']['js'])) {
        \Drupal::logger('debug')->warning('<pre><code>' . print_r($libraries, TRUE) . '

    ');
    // Remove the default font.js file from the 'ckeditor5_font' library.
    unset($libraries['ckeditor5_font']['js']['js/build/font.js']);

    // Add your custom JavaScript file.
    $libraries['ckeditor5_font']['js']['/' . Drupal::service('extension.list.module')->getPath('miscellaneous') . '/libs/ckeditor5_fontjs-override.js'] = [];
    }
    }

  • First commit to issue fork.
  • 🇺🇦Ukraine o_timoshchuk

    I obtained the latest font.js file from the ckeditor5-font package, but it didn't resolve the issue. Therefore, I created a patch and merge request with the modified font.js file.

  • 🇸🇮Slovenia mkrizaj

    Patch attached under original issue: https://www.drupal.org/project/ckeditor5_font/issues/3368736#comment-158... 🐛 Error after update to Drupal 10.1.0 Active

Production build 0.71.5 2024