Error after update to Drupal 10.1.0

Created on 22 June 2023, over 1 year ago

Problem/Motivation

After updating Drupal from 10.0.9 to 10.1.0, CKEditor 5 no longer works.
Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "ckeditor5_codeBlock" CKEditor 5 plugin definition is configurable, has non-empty default configuration but has no config schema. Config schema is required for validation. in Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition->validateDrupalAspects() (line 186 of /home/orcmaorg/public_html/web/core/modules/ckeditor5/src/Plugin/CKEditor5PluginDefinition.php).

I saw this error in an old bug report and removed this module, which fixed the problem.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

1.1

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States tjtj

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

Merge Requests

Comments & Activities

  • Issue created by @tjtj
  • ๐Ÿ‡จ๐Ÿ‡ทCosta Rica maxmendez

    Same fatal error.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom juc1

    Same fatal error for me.

  • ๐Ÿ‡ท๐Ÿ‡ดRomania ita08

    Same fatal error also.

  • ๐Ÿ‡จ๐Ÿ‡ทCosta Rica maxmendez

    Here my approach,

    1- Removed override of ckeditor 5 schema, change schema file name using name of the module and remove all default ckeditor5 records.
    2- Updated Font Plugin to 38.0.1 same version uses by core module ( https://www.drupal.org/project/drupal/releases/10.1.0#frontend-deps โ†’ ).

    Please test in your environments if all is working good, in mine seems to work perfectly.

  • ๐Ÿ‡จ๐Ÿ‡ทCosta Rica maxmendez

    Sorry i did not include the new schema file. Here a new patch.

  • ๐Ÿ‡จ๐Ÿ‡ทCosta Rica maxmendez
  • ๐Ÿ‡จ๐Ÿ‡ทCosta Rica maxmendez

    Removes an unnecessary file

  • guys, run database updates
    by visiting/update.php or vendor/bin/drush updb

  • Same here, after installing this module on version 10.1.1 I'm unable to edit nodes or to configure CKEditor5.
    Luckily it didn't break anything after uninstalling.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rgpublic Dรผsseldorf ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ช๐Ÿ‡บ

    This bug is unfortunately catastrophic for me. After uninstall, I still get this error. What I don't understand is... the config schema is in this file:

    core/modules/ckeditor5/config/schema/ckeditor5.schema.yml

    Why isn't Drupal picking it up? How can I repair / reimport the schema? It seems the whole trouble began because there was a lot of unneccessary schema included in the config file of this module, right? That's why the patch has so many removed lines...

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rgpublic Dรผsseldorf ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ช๐Ÿ‡บ

    PS: It seems I could make it work after adding this to config/schema/ckeditor5.schema.yml. I suspect this section didn't exist in D9's core/modules/ckeditor5/config/schema/ckeditor5.schema.yml and exists now in D10. That's why it's missing. What I still don't understand is why the configuration about all the other plugins has been included in this plugin (a mistake?) and why I now doesn't work when I'm removing it. It should be still available core/modules/ckeditor5/config/schema/ckeditor5.schema.yml. Weird.

    # Plugin \Drupal\ckeditor5\Plugin\CKEditor5Plugin\CodeBlock
    ckeditor5.plugin.ckeditor5_codeBlock:
      type: mapping
      label: Code Block
      mapping:
        languages:
          type: sequence
          orderby: ~
          label: 'Languages'
          constraints:
            NotBlank:
              message: "Enable at least one language, otherwise disable the Code Block plugin."
            UniqueLabelInList:
              labelKey: label
          sequence:
            type: mapping
            label: 'Language'
            mapping:
              label:
                type: label
                label: 'Language label'
              language:
                type: string
                label: 'Language key'
    
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rgpublic Dรผsseldorf ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ช๐Ÿ‡บ

    Aah, I finally found it. Sorry for the spam, but perhaps this is helpful to others. I didn't notice it in the patch but the most important change (after cleaning up the schema yml) is the *change of the filename(!)*. The filename must be "[modulename].schema.yml" not "ckeditor5.schema.yml". Otherwise your schema will *override* the schema with the same name in core (core/modules/ckeditor5/config/schema/ckeditor5.schema.yml). All the problems arise from this single issue. So make sure after applying the patch, that the original "ckeditor5.schema.yml" really isn't there anymore.

  • ๐Ÿ‡ต๐Ÿ‡ฑPoland piotr pakulski Poland ๐Ÿ‡ช๐Ÿ‡บ

    patch #8 works fine for me

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    Whatever about the included js/build/font.js file in #8, the correct solution here would be to rename the schema file, which this barebones patch file will do. Note, you need to apply it using "git apply" as I don't think "patch -p1" will rename files.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    This patch should work with the "patch" command.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    The more you know: when creating a patch that renames files, use the "--no-renames" option to make "git diff HEAD" give a more verbose patch that doesn't rename, instead it shows the old file being removed and the new file being created.

    If you're trying to use this module via composer - if you have the module tied to a specific branch snapshot (e.g. "ckeditor5_font":"dev-1.x" or "ckeditor5_font":"1.x-dev") then use the patch from #15, otherwise use the patch from #16.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States wstocker

    Simply renaming the file in patch #16 worked for me on 10.1.1

  • The patch on #16 don't have the color picker feature on the font color and font backgroung color that #8 has, so I'm just sending a new patch based on #8 for those who want this feature.

    We have one issue on the ckeditor5 github which is related to this color picker feature, the green check button that we have on the color picker is trying to submit the form when you try to add the color that you chose. (read more here: https://github.com/ckeditor/ckeditor5/issues/14361)

    This way I found that inside that font.js on patch #8 we have the type for this button, declared as "submit", just changed to "button" and now is working as expected.

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland sir_squall

    I just did the drupal uprade, and I got this error back again, do you know when this will be apply to the drupal 10 core?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    Should the font plugin change be done in a separate issue, are there any concerns it would break compatibility with 9.5 or 10.0?

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Does your dog bite

    As the error showed 'InvalidPluginDefinitionException' and I had ckeditor5_font feature installed, I decided to remove this and install
    drupal/ckeditor_font:^2.0@beta' instead.

    The error went away for me.

    Didn't look further into it, but patches didn't work on my version: 10.1.2

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland sir_squall

    I just tried to install this module, and when I updated drupal to 10.1.3 I didn't get the error, thanks

  • ๐Ÿ‡ณ๐Ÿ‡ฌNigeria chike Nigeria

    Patch #19 is working.

  • ๐Ÿ‡ต๐Ÿ‡ฑPoland piotr pakulski Poland ๐Ÿ‡ช๐Ÿ‡บ

    patch #19 also is working for me

  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡ฑ๐Ÿ‡ปLatvia mansspams

    This then.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kay_v

    just updating the issue title to be more descriptive

  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kay_v

    on a fresh install, the following error occurs

    TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter() (line 141 of /var/lib/tugboat/stm/web/modules/contrib/ckeditor5_font/src/FontColorsManager.php).

    To reproduce the error on a fresh install:

    1. enable the patched module
    2. visit the configuration page of a text format
    3. Drag & drop the color and background widgets from to the active toolbar
    4. click save

    Expected outcome: config page reloads with success message.
    Current outcome: the above error loads.

  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States kay_v

    This issue status is accurately RTBC. It relies on other patches.

    To implement this module, first apply the following (the list includes the patch from comment #19):

                    "Settings submit fix": "https://www.drupal.org/files/issues/2022-12-16/2-fix-empty-form-value-validation.patch",
                    "array_filter()": "https://www.drupal.org/files/issues/2023-04-21/3350333-5.patch",
                    "config schema error": "https://www.drupal.org/files/issues/2023-08-07/error-after-drupal-10.1.0-3368736-19.patch"
    
  • ๐Ÿ‡ง๐Ÿ‡ดBolivia xjkwak

    Thank you @kay_v.
    Applying the patches you recommend works for me too.

  • Hello #29 works perfectly but if used together with the ckeditor font size โ†’ module they start to have problems when used together

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    @Nelo: You should only one one of these modules.

  • @DamienMcKenna Hello but is there a way to enable font size

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    Can you use ckeditor_font for all of your requirements?

  • same problem going from 10.1.1 to 10.2
    for my part it came from the module "ckeditor5_font"
    I modified the name of the file "/modules/contrib/ckeditor5_font/config/schema/ckeditor5.schema.yml" to "/modules/contrib/ckeditor5_font/config/schema/ckeditor5_font .schema.yml"
    and everything is back to normal

  • Then going from 10.1.4 to 10.2.0 I had to modify my file "/modules/contrib/ckeditor5_font/config/schema/ckeditor5_font .schema.yml" to use the schema defined in "/core/modules/ckeditor5 /config/schema/ckeditor5.schema.yml/"

    So go from:

    # Plugin \Drupal\ckeditor5\Plugin\CKEditor5Plugin\ListPlugin
    ckeditor5.plugin.ckeditor5_list:
      type: mapping
      label:List
      mapping:
        reversed:
          type: boolean
          label: 'Allow reverse list'
          constraints:
            NotNull: []
        startIndex:
          type: boolean
          label: 'Allow start index'
          constraints:
            NotNull: []

    has

    # Plugin \Drupal\ckeditor5\Plugin\CKEditor5Plugin\ListPlugin
    ckeditor5.plugin.ckeditor5_list:
      type: mapping
      label:List
      mapping:
        properties:
          type: mapping
          mapping:
            label: 'Allowed list attributes'
            reversed:
              type: boolean
              label: 'Allow reverse list'
              constraints:
                NotNull: []
            startIndex:
              type: boolean
              label: 'Allow start index'
              constraints:
                NotNull: []
        multiBlock:
          type: boolean
          label: 'Allow blocks to be created in list items'
          constraints:
            NotNull: []

    in ""/modules/contrib/ckeditor5_font/config/schema/ckeditor5_font.schema.yml"

    Don't forget to rename "/modules/contrib/ckeditor5_font/config/schema/ckeditor5.schema.yml" to "/modules/contrib/ckeditor5_font/config/schema/ckeditor5_font .schema.yml" if this is not already done

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance mably

    Just published a patch that you can apply to the dev branch to make the module work. Tested on Drupal 10.2.1.

  • Merge request !4Fix schema file โ†’ (Open) created by mably
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium johan1

    Is this patch still working for 10.2.2. Applied the patch but error (no config schema) remains.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance Julien Tekrane

    I copied and pasted the Ckeditor 5 schema from Core + Add the custom plugin.

    In the future, the idea should be to extend YML files, not override, else on each change in Core there will be an issue.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance jabberwooki

    Thank you @mably.

    I updated my site from 10.1.6 to 10.2.2 (for security updates) and I installed the module's dev branch using Composer :
    composer require 'drupal/ckeditor5_font:1.x-dev@dev'

    Then, I modified the composer.json file as follows :

        "extra": {
    
            [...]
            
            "enable-patching": true,
            "patches": {
                "drupal/ckeditor5_font": {
                    "'no config schema' Error": "https://www.drupal.org/files/issues/2024-01-11/ckeditor5_font-schema-fix-10.2.1-3368736-37.patch"
                }
            }
        }
    

    and ran :
    composer install

    After enabling module
    drush en ckeditor5_font
    and adding Color button and Background button to the CKEditor toolbar for the Full HTML text format (/admin/config/content/formats/manage/full_html), I could get theses buttons working as expected in the rich text editor.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States tjtj

    On one site this patch worked. On the other, I get
    TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter() (line 139 of /home/jamesrom/public_html/blogs/web/modules/contrib/ckeditor5_font/src/FontColorsManager.php).
    Severity Error

  • ๐Ÿ‡ต๐Ÿ‡นPortugal adaragao

    Using Drupal 10.2.3, and CKeditor5_font 1.1.2-beta1, already installed, giving me this error, I apply the 37 patch, and it's working.

    Steps:

    drush un ckeditor5_font
    

    I modified the composer.json file as follows :

        "extra": {
    
            [...]
            
            "enable-patching": true,
            "patches": {
                "drupal/ckeditor5_font": {
                    "'no config schema' Error": "https://www.drupal.org/files/issues/2024-01-11/ckeditor5_font-schema-fix-10.2.1-3368736-37.patch"
                }
            }
        }
    composer update
    
    drush cr
    
    drush en ckeditor5_font
    

    Thanks for the patch !!

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany dbielke1986

    Is there a chance to put this in a new release to get this module to a stable version?

  • @dbielke1986 I agree, it is time to have a stable version and I recommend patch 19 because it generates a button to add colors from the editor

  • ๐Ÿ‡ป๐Ÿ‡ณVietnam linhnm

    I received an error message while upgrading to Drupal 10.3.0.

    The mapping definition at `ckeditor5.plugin.ckeditor5_list:properties` is invalid: its `label` key contains a string.
    
  • ๐Ÿ‡ป๐Ÿ‡ณVietnam linhnm

    Fix the patch #47

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States froboy Chicago, IL

    Tested #37 on Drupal 10.2.7 and it didn't work for me (still gave the WSOD with the notice in the issue summary), but #48 works.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance jabberwooki

    @linhnm In order to fix the same error, obtained in same condition as you (core update from 10.2.6 to 10.3.1) :
    - I first added patch #47 AND patch #48 declarations into my composer.json file.
    - Then I launched composer install.
    As a result, I noticed that patch #48 could not apply and the mapping definition bug (WSOD) still occurred.

    So, I did the following :
    - I came back to my original /config/schema/ckeditor5_font.schema.yml version.
    - I removed the #48 patch declaration from the composer.json file.
    - I launched composer install again.
    Using this second procedure, the bug disappeared and I could edit nodes containing ckeditor fields again.

    I don't clearly understand what #48 patch does (I'm far from being a patching guru). I just can tell that it can't be applied in my environment. I suppose that lines 3 et 4 correspond to a target file renaming (from ckeditor5.schema.yml to ckeditor5_font.schema.yml) but the error message I got (in /var/log/apache2/mysite_error.log says the ckeditor5_font.schema.yml file cannot be found.
    Hope this helps.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States froboy Chicago, IL

    @jabberwooki it looks like the patch in #47was uploaded by mistake, which it was hidden by the comment in #48.

    If you're using that version, you'll only need the patch from #48. So, the record in composer.json > extra > patches would look something like this:

            "drupal/ckeditor5_font": {
                "Issue #3368736: no config schema' Error after update to Drupal 10.1.0": "https://www.drupal.org/files/issues/2024-06-25/ckeditor5_font-schema-fix-10.3.x-3368736-48_0.patch"
             }
    
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia someshver Panchkula

    This patch #48 is conflicting with this issue.
    https://www.drupal.org/project/drupal/issues/3274635 โœจ [upstream] Use CKEditor 5's native and UX Needs work

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia someshver Panchkula

    I have created a patch to be compatible with drupal 10.3.1 and https://www.drupal.org/project/drupal/issues/3274635 โœจ [upstream] Use CKEditor 5's native and UX Needs work issue.

  • What is the order of patches to run, because since patch #19 they no longer work together

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance Julien Tekrane

    Thanks @someshver
    #53 solved my issue with Drupal 10.3.2

  • ๐Ÿ‡ง๐Ÿ‡ทBrazil andre.bonon

    I tested the #48 ๐Ÿ› Error after update to Drupal 10.1.0 Active and works for me with 10.2.7.

  • ckeditor5_font-schema-fix-10_3_x-3368736-53.patch

    TypeError: Cannot read properties of undefined (reading 'colorPaletteIcon')
    at h._createColorPickerButton (font.js?v=31.0.0:5:13188)
    at h.render (font.js?v=31.0.0:5:12277)
    at h. (ckeditor5-dll.js?v=41.3.1:5:666767)
    at h.fire (ckeditor5-dll.js?v=41.3.1:5:663135)
    at [as render] (ckeditor5-dll.js?v=41.3.1:5:666819)
    at d._renderViewIntoCollectionParent (ckeditor5-dll.js?v=41.3.1:5:487553)
    at d. (ckeditor5-dll.js?v=41.3.1:5:486893)
    at d.fire (ckeditor5-dll.js?v=41.3.1:5:663135)
    at d.addMany (ckeditor5-dll.js?v=41.3.1:5:687745)
    at d.add (ckeditor5-dll.js?v=41.3.1:5:687466)

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada michael.barlow@mirumagency.com

    #53 doesn't work for me. I start with the error
    The mapping definition at `ckeditor5.plugin.ckeditor5_list:properties` is invalid: its `label` key contains a string.
    but once I apply #53, I then get:

    Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "ckeditor5_codeBlock" CKEditor 5 plugin definition is configurable, has non-empty default configuration but has no config schema. Config schema is required for validation. in Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition->validateDrupalAspects() (line 186 of /home/orcmaorg/public_html/web/core/modules/ckeditor5/src/Plugin/CKEditor5PluginDefinition.php).

    The only thing that worked for me was the merge request

  • Both patch #53 and the recommendation of #58 work well, the sad thing is that the color selector option that the same editor could use in patch 19 was lost. I hope at some point they will include it again

  • ๐Ÿ‡ธ๐Ÿ‡ฎSlovenia mkrizaj

    After the update to drupal core 10.3.6 ckeditor5_font module stopped working. I couldn't open colorPallete anymore in CKEditor.

    I was getting console error: CKEditorError: Cannot read properties of undefined (reading 'colorPaletteIcon')

    I noticed that font.js file was changed or compiled wrong so I recreated a patch that includes #19 and also fix for colorPallete.

    What I had to change is: update icon:i.icons.colorPaletteIcon to icon:e.icons.colorPaletteIcon

  • @mkrizaj

    This error appears when I try to activate the colors from text format and it doesn't let me activate everything:
    Uncaught TypeError: Drupal.EditorFeature is not a constructor
    at editorFeature (linkit.filter_html.admin.js?v=10.3.6:41:25)
    at Object.attach (linkit.filter_html.admin.js?v=10.3.6:21:21)
    at drupal.js?v=10.3.6:166:24
    at Array.forEach ()
    at Drupal.attachBehaviors (drupal.js?v=10.3.6:162:34)
    at HTMLDivElement. (ajax.js?v=10.3.6:1389:18)
    at Function.each (jquery.min.js?v=3.7.1:2:3129)
    at ce.fn.init.each (jquery.min.js?v=3.7.1:2:1594)
    at Drupal.AjaxCommands.insert (ajax.js?v=10.3.6:1381:19)
    at ajax.js?v=10.3.6:1046:41

Production build 0.71.5 2024