AssertionError switching to CKE5

Created on 21 December 2023, 9 months ago
Updated 13 February 2024, 7 months ago

when switching from CKE4 to CKE5 on a Drupal 10 site for "plain text" format I get a message "Oops, something went wrong. Check your browser's developer console for more details."

log entry:
AssertionError: This should only be called if this plugin is actually enabled, which requires <a> to be allowed. in assert() (Zeile 48 in /var/www/html/web/modules/contrib/editor_advanced_link/src/Plugin/CKEditor4To5Upgrade/AdvancedLink.php).

Texteditor config:

uuid: ce9910a8-401f-4d86-be2a-36563937c389
langcode: de
status: true
dependencies:
  config:
    - filter.format.plain_text
  module:
    - ckeditor
format: plain_text
editor: ckeditor
settings:
  toolbar:
    rows:
      -
        -
          name: Formatierung
          items:
            - Bold
            - Italic
        -
          name: Links
          items:
            - DrupalLink
            - DrupalUnlink
        -
          name: Listen
          items:
            - BulletedList
            - NumberedList
        -
          name: Media
          items:
            - Blockquote
            - DrupalImage
        -
          name: Tools
          items:
            - Source
  plugins: {  }
image_upload:
  status: false
  scheme: public
  directory: inline-images
  max_size: ''
  max_dimensions:
    width: null
    height: null

Textformat config:

uuid: 5d2a363b-6eca-4e86-a728-19ef77e64666
langcode: de
status: true
dependencies:
  module:
    - blazy
    - slick
    - toc_filter
_core:
  default_config_hash: NIKBt6kw_uPhNI0qtR2DnRf7mSOgAQdx7Q94SKMjXbQ
name: 'Plain text'
format: plain_text
weight: -6
filters:
  filter_html_escape:
    id: filter_html_escape
    provider: filter
    status: true
    weight: 0
    settings: {  }
  filter_url:
    id: filter_url
    provider: filter
    status: true
    weight: 1
    settings:
      filter_url_length: 72
  filter_autop:
    id: filter_autop
    provider: filter
    status: true
    weight: 2
    settings: {  }
  filter_html:
    id: filter_html
    provider: filter
    status: false
    weight: -10
    settings:
      allowed_html: '<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src alt data-entity-type data-entity-uuid data-align data-caption>'
      filter_html_help: true
      filter_html_nofollow: false
  slick_filter:
    id: slick_filter
    provider: slick
    status: false
    weight: 4
    settings:
      caption:
        alt: '0'
        title: '0'
      optionset: default
      layout: ''
      background: false
      box_caption: ''
      box_caption_custom: ''
      box_media_style: ''
      loading: ''
      box_style: ''
      image_style: ''
      media_switch: ''
      ratio: ''
      thumbnail_style: ''
      grid: ''
      grid_medium: ''
      grid_small: ''
      style: ''
      skin: ''
      overridables:
        arrows: '0'
        autoplay: '0'
        dots: '0'
        draggable: '0'
        infinite: '0'
        mouseWheel: '0'
        randomize: '0'
        variableWidth: '0'
      optionset_thumbnail: ''
      skin_thumbnail: ''
      thumbnail_caption: ''
      thumbnail_effect: ''
      thumbnail_position: ''
      override: false
      skin_arrows: ''
      skin_dots: ''
      color: ''
      arrowpos: ''
      dotpos: ''
      hover: ''
      preserve_keys: false
      visible_items: null
  blazy_filter:
    id: blazy_filter
    provider: blazy
    status: false
    weight: 3
    settings:
      media_switch: ''
      hybrid_style: ''
      box_style: ''
      box_media_style: ''
      box_caption: ''
      filter_tags:
        img: img
        iframe: iframe
      use_data_uri: '0'
  toc_filter:
    id: toc_filter
    provider: toc_filter
    status: false
    weight: 0
    settings:
      type: default
      auto: ''
      block: '0'
      exclude_above: '0'
💬 Support request
Status

Closed: cannot reproduce

Version

11.0 🔥

Component
CKEditor 5 

Last updated 2 days ago

Created by

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

Comments & Activities

  • Issue created by @nojj
  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    Aha. You were somehow using CKEditor 4 on the plain_text format, which doesn't even contain/render HTML 😅

    That never made sense. 🙈 And can't have worked AFAIK.

    Just disable CKEditor 4 on that text format and you're good to go.

    If CKEditor 4 worked fine on that text format, please provide a video/GIF to show how it worked 🤯

  • thanks for your answer.
    I can confirm this works as fallback option with ck4

  • Status changed to Postponed: needs info 9 months ago
  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    Okay. Well … it was never meant to. You must be using CKEditor just as a way to type text, because not even bolding or creating links will work: if you view content created with CKEditor 4 in this text format, all such markup will be removed due to the way the text format is configured 😅

  • thanks. you are right. markup gets removed if using ckeditor.
    so maybe it shouldn't possible to select creditor for "plain text"

  • Status changed to Closed: cannot reproduce 7 months ago
  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    so maybe it shouldn't possible to select creditor for "plain text"

    It isn't possible. You should get this validation error:

    CKEditor 5 only works with HTML-based text formats. The "Display any HTML as plain text" (filter_html_escape) filter implies this text format is not HTML anymore.
    

    If you can enable CKEditor 5 for the plain text format using just the UI, then please reopen this issue and provide exact steps to reproduce 🙏

Production build 0.71.5 2024