AssertionError: assert($value === TRUE || Inspector::assertAllStrings($value)) in assert() (line 242 of core/modules/ckeditor5/src/HTMLRestrictionsUtilities.php)

Created on 1 January 2022, over 3 years ago
Updated 17 August 2023, over 1 year ago

Problem/Motivation

When adding <script src defer> to the field, it is automatically turned into <script src defer="defer"> after saving. This causes an AssertionError on this line of code.

The website encountered an unexpected error. Please try again later.
AssertionError: assert($value === TRUE || Inspector::assertAllStrings($value)) in assert() (line 242 of core/modules/ckeditor5/src/HTMLRestrictionsUtilities.php).
assert(, 'assert($value === TRUE || Inspector::assertAllStrings($value))') (Line: 242)
Drupal\ckeditor5\HTMLRestrictionsUtilities::allowedElementsStringToHtmlSupportConfig('<cite><dl><dt><dd><blockquote cite><ul type><ol start type><a hreflang target accesskey id rel title data-entity-type data-entity-uuid data-entity-substitution>') (Line: 78)
Drupal\ckeditor5\Plugin\CKEditor5Plugin\SourceEditing->getDynamicPluginConfig(Array, Object) (Line: 254)
Drupal\ckeditor5\Plugin\CKEditor5PluginManager->getCKEditor5PluginConfig(Object) (Line: 805)
Drupal\ckeditor5\Plugin\Editor\CKEditor5->getJSSettings(Object) (Line: 81)
Drupal\editor\Plugin\EditorManager->getAttachments(Array) (Line: 100)
Drupal\editor\Element->preRenderTextFormat(Array)

Steps to reproduce

  1. Add <script src defer> to the field for a text format
  2. Visit a page where an editor instance with that format is rendered, eg. a node edit form

Proposed resolution

Remaining tasks

🐛 Bug report
Status

Closed: duplicate

Version

9.4

Component
CKEditor 5 

Last updated 36 minutes ago

Created by

🇧🇪Belgium dieterholvoet Brussels

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

Comments & Activities

Not all content is available!

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

  • 🇨🇭Switzerland sir_squall

    I just updated from drupal 9.5 to 10.1.2 and I got this error:
    AssertionError: assert(NestedArray::keyExists($subform, $parts)) in assert() (line 892 of core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php).

    it's when I tried to save the styles, I added that inside:
    div.intertitre|intertitre

    and impossible to save.

  • 🇪🇸Spain Carlitus

    I have the same error that @sir_squall

Production build 0.71.5 2024