Issue with text format configuration after uninstall

Created on 20 June 2025, 4 months ago

Problem/Motivation

After an uninstall of this module the "customTable" entry remains present in the Toolbar configuration where CKEditor is set as Text editor for text formats, for example Full HTML. The toolbar configuration displays text entries only instead of icons.

Steps to reproduce

Uninstall module and check out the toolbar configuration for the text format where the "customTable" entry was added.

Proposed resolution

Delete from toolbar configuration (for the relevant text formats) when uninstalled.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands gkaas

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

Merge Requests

Comments & Activities

  • Issue created by @gkaas
  • πŸ‡³πŸ‡±Netherlands gkaas
  • πŸ‡ΊπŸ‡ΈUnited States bronzehedwick New York

    Tested against Drupal 11.x and can confirm this is a bug. On text configuration pages, such as /admin/config/content/formats/manage/full_html, there's a JavaScript error that breaks the CKEditor toolbar, as per above.

    TypeError: undefined is not an object (evaluating '[...dividers, ...available].find((button) => {
      return button.name === name;
    }).id')
    

    On a node edit page that has the text format enabled that has the CKEditor Responsive Table button added, this JavaScript errors appears.

    [Warning] toolbarview-item-unavailable (2) (ckeditor5-dll.js, line 5)
    Object
    
    item: "customTable"
    
    Object Prototype
    "
    Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-toolbarview-item-unavailable"
    
  • πŸ‡ΊπŸ‡ΈUnited States bronzehedwick New York
  • πŸ‡ΊπŸ‡ΈUnited States bronzehedwick New York

    I wrote a fix to address the issue. Please review when you have a chance @gkaas!

  • Assigned to bronzehedwick
  • Status changed to Needs review about 1 month ago
  • First commit to issue fork.
  • @bronzehedwick I moved the function to the .install file since that's where it should go and I made some changes because it wasn't working well for me:
    1- if ($key !== FALSE) to cover the cases where the button is found in the first position.
    2- saved the array_values($toolbar_items) instead of the array as it was because it wasn't removing it for me otherwise.

    Can you test it and see if it works well for you?

  • πŸ‡ΊπŸ‡ΈUnited States bronzehedwick New York

    Thanks @javi-er! I tested the updated code, but ran into the following JS console error when loading the editor page.

    Uncaught TypeError: can't access property "id", [].find(...) is undefined
    

    Here are the steps I took.

    1. Updated CKEditor Responsive Table code
    2. Enable the module: drush en ckeditor_responsive_table -y
    3. Enable the button on the Basic HTML text filter
    4. Confirm the button works on a node edit page
    5. Confirm the "customTable" entry exists in editor.editor.basic_html config table
    6. Disable the module: drush pm-uninstall ckeditor_responsive_table -y
    7. Observe the "customTable" entry still exists in editor.editor.basic_html config table
    8. Visit /admin/config/content/formats/manage/basic_html
    9. Observe the above JS error
  • πŸ‡ΊπŸ‡ΈUnited States bronzehedwick New York
Production build 0.71.5 2024