logic exception in Drupal\Core\Config\Schema\Mapp

Created on 27 June 2024, 4 months ago
Updated 17 September 2024, about 1 month ago

Problem/Motivation

php      Error      LogicException: The mapping definition at
                                               `ckeditor5.plugin.ckeditor5_list:properties` is invalid: its `label`
                                               key contains a string. It must be an array. in
                                               Drupal\Core\Config\Schema\Mapp

Steps to reproduce

Since 10.3 upgrade

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Closed: works as designed

Version

10.3

Component
CKEditor 5 

Last updated 3 days ago

Created by

🇺🇸United States tjtj

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

Comments & Activities

  • Issue created by @tjtj
  • 🇺🇸United States tjtj

    It does this on multiple sites.

  • Status changed to Postponed: needs info 4 months ago
  • This is probably unveiled because the config is now validated after 📌 Mark config schema for CKEditor 5 text editor settings + each configurable CKEditor 5 plugin as FullyValidatable Active . That site has an invalid properties key in its ckeditor5_list configuration. The properties key should be a map (array) and its only two keys are reversed and startIndex. Both are booleans.

    When you export the site configuration, what exactly is present in the ckeditor5_list configuration key in the editor.editor.*.yml files?

    I am marking this as needs steps to reproduce as more information is needed to take this on as a bug because the config schema is clear about this.

  • 🇺🇸United States tjtj

    I can't edit anything on any site now
    And cannot turn off CKEditor5

  • 🇺🇸United States tjtj

    I think this is the file

  • 🇺🇸United States tjtj

    Reverting to 10.2.7 fixes this

  • 🇺🇸United States tjtj

    I have never needed it before. The upgrade to 10.3 wronked all my sites. I do not see what the configuration system does for this, nor how to use it. Updating core should not do this to me. So yes, some more hints please.
    Was ckeditor5.ckeditor5.yml the correct file? What is wrong with it?

  • It is probably one of the files named editor.editor.*.yml, where * will vary.

  • 🇺🇸United States tjtj

    Where are these files?

  • You export the site configuration to see them.

  • 🇺🇸United States tjtj

    See uploaded files. If you had been more specific in your instructions, I would have provided them days ago.

  • Those look ok. If I were you I would search the entire exported site configuration for ckeditor5_list to see if there is a label key affiliated with it.

    Someone else has the same error: 🐛 CKEditor 5 not working with Drupal 10.3 Postponed: needs info .

    I have neither the time nor the energy to explain the configuration system for no pay.

  • 🇺🇸United States tjtj

    Sorry. Explain was not needed. Saying it was in site export would have helped. But this list is in the three attached files.

    sh-3.2# grep -rnw './config-orcma-dyndns-org-2024-06-29-15-19/' -e "ckeditor5_list"
    ./config-orcma-dyndns-org-2024-06-29-15-19//editor.editor.basic_html.yml:73: ckeditor5_list:
    ./config-orcma-dyndns-org-2024-06-29-15-19//editor.editor.full_html.yml:122: ckeditor5_list:
    ./config-orcma-dyndns-org-2024-06-29-15-19//editor.editor.webform_default.yml:42: ckeditor5_list:

    So what is wrong?

      ckeditor5_list:
          properties:
            reversed: true
            startIndex: true
          multiBlock: true
        ckeditor5_plugin_pack_font__font_color:
          colors: {  }
          use_default_colors: true
        ckeditor5_plugin_pack_font__font_family:
          options: ''
        ckeditor5_plugin_pack_font__font_size:
          options: ''
        ckeditor5_sourceEditing:
          allowed_tags: {  }
        ckeditor_link_styles_linkStyles:
          styles:
            -
              label: 'Button color: Primary'
              element: '<a class="button primary">'
            -
              label: 'Button color: Secondary'
              element: '<a class="button secondary">'
            -
              label: 'Button color: Success'
              element: '<a class="button success">'
            -
              label: 'Button color: Alert'
              element: '<a class="button alert">'
            -
              label: 'Button color: Warning'
              element: '<a class="button warning">'
            -
              label: 'Button size: Tiny'
              element: '<a class="button tiny">'
            -
              label: 'Button size: Small'
              element: '<a class="button small">'
            -
              label: 'Button size: Large'
              element: '<a class="button large">'
            -
              label: 'Button style: Expanded'
              element: '<a class="button expanded">'
            -
              label: 'Button style: Hollow'
              element: '<a class="button hollow">'
            -
              label: 'Button style: Clear'
              element: '<a class="button clear">'
            -
              label: 'Button style: Disabled'
              element: '<a class="button disabled">'
        media_media:
          allow_view_mode_override: true
        openai_ckeditor_openai:
          completion:
            enabled: true
            model: gpt-3.5-turbo
            temperature: 0.2
            max_tokens: 512
  • That site has some CKEditor plugin modules installed. It looks like their config may clash with CKEditor's allowed config, now that config is enforced. For example, 🐛 Unable to save text format config form in 10.3 with shortcode module Active .

  • 🇮🇱Israel YuvalBH

    I had the same issue with both of my websites, I downgraded the core to 10.2.7 for now

  • 🇮🇱Israel YuvalBH

    though I don't have a multi-site, eventually taking it back to 10.2.7 fixed the issue.
    you need to understand why the 10.3 expect an array to open the data for CKEditor, it might be a very simple issue of method argument definition.

  • 🇺🇸United States mortona2k Seattle

    I recently patched a handful of modules to fix issues with saving text formats. They all needed a schema.yml file, with the new correct syntax: https://www.drupal.org/node/3419181

    I looked at doing it for shortcode, but since the schema is defined by plugins, I'm not sure how to do it. Here's an issue I created for the shortcode module: https://www.drupal.org/project/shortcode/issues/3457731 🐛 Unable to save text format config form in 10.3 RTBC

  • 🇺🇸United States tjtj

    Which modules?
    CKEditor Find/Replace
    This plugin module adds the find and replace dialog to CKEditor 5 in Drupal 9 or 10

      `ckeditor5.plugin.ckeditor5_list:properties` is invalid: its `label`
                                                   key contains a string. It must be an array. in
                                                   Drupal\Core\Config\Schema\Mapp

    I did find nbsp installed and used in Full_HTML. I downgraded core, removed its use, uninstalled it, removed it, upgraded core, and got the same error.
    ckeditor5_list is unchanged. I then uninstalled ckeditor_link_styles since most of the entries in ckeditor5_list see3med to be in ckeditor_link_styles_linkStyles. But they are still in editor.editor.full_html.yml even after removing the module.
    Here is the whole file:

    uuid: 01223bde-4b60-44eb-bcad-d906f3860401
    langcode: en
    status: true
    dependencies:
      config:
        - filter.format.full_html
      module:
        - ckeditor5
    format: full_html
    editor: ckeditor5
    settings:
      toolbar:
        items:
          - heading
          - sourceEditing
          - bold
          - italic
          - fontBackgroundColor
          - fontColor
          - fontFamily
          - link
          - fontSize
          - findAndReplace
          - imce_link
          - drupalInsertImage
          - imce_image
          - blockQuote
          - codeBlock
          - bulletedList
          - numberedList
          - horizontalLine
          - alignment
          - SimpleAds
          - '-'
          - insertTable
          - indent
          - outdent
          - lineHeight
          - drupalMedia
          - specialCharacters
          - openai
      plugins:
        ckeditor5_alignment:
          enabled_alignments:
            - center
            - justify
            - left
            - right
        ckeditor5_codeBlock:
          languages:
            -
              label: 'Plain text'
              language: plaintext
            -
              label: C
              language: c
            -
              label: 'C#'
              language: cs
            -
              label: C++
              language: cpp
            -
              label: CSS
              language: css
            -
              label: Diff
              language: diff
            -
              label: HTML
              language: html
            -
              label: Java
              language: java
            -
              label: JavaScript
              language: javascript
            -
              label: PHP
              language: php
            -
              label: Python
              language: python
            -
              label: Ruby
              language: ruby
            -
              label: TypeScript
              language: typescript
            -
              label: XML
              language: xml
        ckeditor5_font_colors:
          colors: '[{"color":"#000000","label":""},{"color":"#0432ff","label":""},{"color":"#aa7941","label":""},{"color":"#00fcff","label":""},{"color":"#00f900","label":""},{"color":"#ff40ff","label":""},{"color":"#ff9200","label":""},{"color":"#932092","label":""},{"color":"#ff2600","label":""},{"color":"#fefb00","label":""},{"color":"#feffff","label":""},{"color":"#949494","label":"Gray"}]'
        ckeditor5_heading:
          enabled_headings:
            - heading1
            - heading2
            - heading3
            - heading4
            - heading5
            - heading6
        ckeditor5_imageResize:
          allow_resize: true
        ckeditor5_line_height_line_height:
          line_height_options:
            - '0'
            - '0.5'
            - '1'
            - '1.5'
            - '2'
            - '2.5'
            - '3'
            - '3.5'
            - '4'
            - '4.5'
            - '5'
            - '5.5'
            - '6'
            - '6.5'
        ckeditor5_list:
          properties:
            reversed: true
            startIndex: true
          multiBlock: true
        ckeditor5_plugin_pack_font__font_color:
          colors: {  }
          use_default_colors: true
        ckeditor5_plugin_pack_font__font_family:
          options: ''
        ckeditor5_plugin_pack_font__font_size:
          options: ''
        ckeditor5_sourceEditing:
          allowed_tags: {  }
        ckeditor_link_styles_linkStyles:
          styles:
            -
              label: 'Button color: Primary'
              element: '<a class="button primary">'
            -
              label: 'Button color: Secondary'
              element: '<a class="button secondary">'
            -
              label: 'Button color: Success'
              element: '<a class="button success">'
            -
              label: 'Button color: Alert'
              element: '<a class="button alert">'
            -
              label: 'Button color: Warning'
              element: '<a class="button warning">'
            -
              label: 'Button size: Tiny'
              element: '<a class="button tiny">'
            -
              label: 'Button size: Small'
              element: '<a class="button small">'
            -
              label: 'Button size: Large'
              element: '<a class="button large">'
            -
              label: 'Button style: Expanded'
              element: '<a class="button expanded">'
            -
              label: 'Button style: Hollow'
              element: '<a class="button hollow">'
            -
              label: 'Button style: Clear'
              element: '<a class="button clear">'
            -
              label: 'Button style: Disabled'
              element: '<a class="button disabled">'
        media_media:
          allow_view_mode_override: true
        openai_ckeditor_openai:
          completion:
            enabled: true
            model: gpt-3.5-turbo
            temperature: 0.2
            max_tokens: 512
    image_upload:
      status: true
      scheme: public
      directory: inline-images
      max_size: ''
      max_dimensions:
        width: 0
        height: 0
    
  • 🇺🇸United States tjtj

    as per mortona2k, I searched all my modules
    /web/modules/contrib # grep -rnw ./ -e "type: filter"
    and got no hits.

  • 🇺🇸United States tjtj

    Would uninstalling and reinstalling ckeditor5 fix this?
    Would I need to uninstall all the plugins too, or is just changing all content types to text editor?

  • Status changed to Active 4 months ago
  • I don't know. There is evidently some configuration conflict happening.

  • 🇺🇸United States mortona2k Seattle

    @tjtj here's the issues I worked on:
    https://www.drupal.org/project/prism/issues/3456476 🐛 Fix missing schema Fixed
    https://www.drupal.org/project/collapse_text/issues/3456477 🐛 Fix missing schema Needs review
    https://www.drupal.org/project/ace_editor/issues/2941227 🐛 Fix Missing install/schema Needs review

    The name of the schema property is important:

    filter_settings.FILTER_PLUGIN_ID.

  • Status changed to Postponed: needs info 4 months ago
  • 🇺🇸United States tjtj
    # grep -rnw './' -e "filter_settings"
    ./webform/src/Form/AdminConfig/WebformAdminConfigFormsForm.php:90:    $form['filter_settings'] = [
    ./webform/src/Form/AdminConfig/WebformAdminConfigFormsForm.php:96:    $form['filter_settings']['limit'] = [
    ./webform/src/Form/AdminConfig/WebformAdminConfigFormsForm.php:111:    $form['filter_settings']['filter_category'] = [
    ./webform/src/Form/AdminConfig/WebformAdminConfigFormsForm.php:120:    $form['filter_settings']['filter_state'] = [
    ./slick/config/schema/slick.schema.yml:310:filter_settings.slick_filter:
    ./blazy/config/schema/blazy.schema.yml:163:filter_settings.blazy_filter:
  • 🇺🇸United States tjtj

    I uninstalled every CKEditor5 plugin and CKEditor itself (having removed CKEditor from the full_html and basic_html content editors. 10.3 works, and the editor.editor files are gone from configuration exports. I will now enable stuff one at a time.

  • 🇺🇸United States tjtj

    Bingo! Installing https://www.drupal.org/project/ckeditor5_font throws this error!

    uninstalling it removes the error. I am filing this with that project.

  • 🇺🇸United States imran1217

    I have following sets of module enabled, getting same error. Is there a way we can disable that schema check unit it get fixed?

    Modules

    drupal/ckeditor5_font       1.1.2-beta1 Allows to control the text and background color directly inside the CKEditor 5 interface.
    drupal/ckeditor5_fullscreen 1.0.0-beta8 A Fullscreen / Maximize button for CKeditor5
    drupal/ckeditor5_template   1.0.7       Integrates the CKEditor 5 templates plugin.
    

    Errors:

    The website encountered an unexpected error. Try again later.
    
    LogicException: The mapping definition at `ckeditor5.plugin.ckeditor5_list:properties` is invalid: its `label` key contains a string. It must be an array. in Drupal\Core\Config\Schema\Mapping->__construct() (line 38 of core/lib/Drupal/Core/Config/Schema/Mapping.php). 
    
  • 🇺🇸United States imran1217

    Ah! it caused by one of the patch I am using : https://www.drupal.org/project/ckeditor5_font/issues/3368736 🐛 'no config schema' Error after update to Drupal 10.1.0 RTBC need to fix there, I'll update it.

    "drupal/ckeditor5_font": {
                    "3368736 - 'no config schema' Error": "https://www.drupal.org/files/issues/2024-01-25/ckeditor5_font-schema-fix-3368736-40.patch",
                    "3350333 - TypeError: array_filter(): Argument #1 ($array) must be of type array": "https://www.drupal.org/files/issues/2023-04-21/3350333-5.patch"
                }
    
  • 🇺🇸United States ACoolDevDude California

    I've tested trying to save the editor setup, but when I do I get this error:

    Error message
    'config' is not a supported key.
    'spec' is not a supported key.
    'help' is not a supported key.
    'helplong' is not a supported key.

    This is after I've uninstalled CK Editor 5, cleared cache, and re-installed it, as well as removed all possible contrib modules that could tie into the module (Linkit, etc). This error is coming from a vanilla CK Editor instance, clear of any existing configuration (IE - no existing configuration).

    Because of this, this makes trying to create a new site / project using D10.3 unable to be accomplished successfully.

  • 🇺🇸United States mortona2k Seattle

    @CozyDrupalNerd looks like that's coming from the htmlawed module.

  • 🇺🇸United States loopy1492

    This has been noticed during https://www.drupal.org/project/ckeditor_liststyle/issues/3326957 🌱 Make ckeditor_liststyle compatible with ckeditor5 RTBC

  • 🇪🇸Spain taote

    I have a similar problem:

    'check_roles' is not a supported key.
    'tablesaw_type' is not a supported key.
    'tablesaw_persist' is not a supported key.
    'clean_all' is not a supported key.
    'insert_before' is not a supported key.
    'insert_after' is not a supported key.
    'replace_empty' is not a supported key.

    After doing the grep -rnw ./ -e "type: filter" I got the following result:

    ./editor_button_link/config/schema/editor_button_link.schema.yml:3:  type: filter
    ./responsive_table_filter/config/schema/responsive_table_filter.schema.yml:2:  type: filter
    ./responsive_tables_filter/config/schema/responsive_tables_filter.schema.yml:11:  type: filter
    ./ckeditor/tests/modules/config/schema/ckeditor_test.schema.yml:10:  type: filter
    ./insert_block/config/schema/insert_block.schema.yml:2:type: filter
    ./linkit/config/schema/linkit.schema.yml:95:  type: filter
    ./pathologic/config/schema/pathologic.schema.yml:21:  type: filter

    So, if I have understood well, the problem is that these values are not defined in the schema file for these modules.

    How come modules so popular as Linkit and Pathologic have these problems? Is it necessary to create a patch for each module? Or is there a way to do fix it from a custom module?

  • 🇮🇳India rohit-rajput-sahab Uttam Nagar, Delhi

    After upgrading to Drupal version 10.3, the same problem keeps happening. Can it be fixed without reverting to an earlier version of Drupal?

    LogicException: The mapping definition at `ckeditor5.plugin.ckeditor5_list:properties` is invalid: its `label` key contains a string. It must be an array. in Drupal\Core\Config\Schema\Mapping->__construct() (line 38 of core\lib\Drupal\Core\Config\Schema\Mapping.php).

  • 🇺🇸United States loopy1492

    I'm sure many of us would be happy to contribute to these modules that are having a problem with these new checks, but I think it would be nice for a link to instructions on how to resolve it for them rather than having to reverse engineer the core code that was changed.

  • 🇮🇱Israel YuvalBH

    take this into consideration:
    If you are updating from 10.2.x or earlier and have the CKEditor font module installed, you should consider switching to CKEditor5 Plugin pack for a more up-to-date version of the plugin which is compatible with the CKEditor5 version shipped with Drupal 10.3.

    so I uninstall the 'Ckeditor font' module,
    installed drupal 10.3.1
    installed the 'CKeditor Plugin pack', and installed the 'CKEditor 5 Font Plugins' which is part of it
    everything works fine, and I can edit my content with 'full_html"
    I still have a console error (which doesn't seems to have an effect at all) :

    settings_tray.js?v=10.3.1:171 Uncaught TypeError: Cannot read properties of null (reading 'id')
    at settings_tray.js?v=10.3.1:171:31
    at Array.forEach ()
    at prepareAjaxLinks (settings_tray.js?v=10.3.1:162:8)
    at HTMLDocument. (settings_tray.js?v=10.3.1:191:5)
    at HTMLDocument.dispatch (jquery.min.js?v=3.7.1:2:40035)
    at v.handle (jquery.min.js?v=3.7.1:2:38006)
    at Object.trigger (jquery.min.js?v=3.7.1:2:70124)
    at HTMLDocument. (jquery.min.js?v=3.7.1:2:70726)
    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)

  • 🇺🇸United States mortona2k Seattle

    @loopy1492 - Check the drupal change records for things like this.

    https://www.drupal.org/node/3419181

  • 🇮🇱Israel YuvalBH

    the issue was resolved after uninstalling the module: CKEditor 5 - Font Plugin
    for Drupal 10.3, and font color use the CKEditor5 Plugin pack

  • 🇺🇸United States ACoolDevDude California

    @YuvalBH - That error is from the settings_tray core module. There is a patch in this issue queue that fixes it: https://www.drupal.org/project/drupal/issues/3458067 🐛 Contextual links disappear intermittently leading to console errors Active

  • Thanks @imran1217!
    For me, this combination works for Drupal 10.3.1:

    "drupal/ckeditor5_font": {
                    "3368736 - 'no config schema' Error": "https://git.drupalcode.org/project/ckeditor5_font/-/merge_requests/8.patch",
                    "3350333 - TypeError: array_filter(): Argument #1 ($array) must be of type array": "https://www.drupal.org/files/issues/2023-04-21/3350333-5.patch"
                }
  • Status changed to Closed: works as designed about 1 month ago
  • 🇦🇺Australia pameeela

    Seems like this is being addressed in the relevant contrib modules, and it is not a core bug, so I'm going to close this.

Production build 0.71.5 2024