Error while using linkit plugin in text editor format

Created on 17 December 2024, 3 days ago

Problem/motivation

We have a text format where we use the Linkit plugin and in version 6.1 it worked correctly when entering a node that uses this text format. Then we update to version 7.0 and when entering the same link it no longer works and throws the following error:
Drupal\Component\Plugin\Exception\PluginException: Plugin (drupallink) instance class "Drupal\linkit\Plugin\CKEditorPlugin\LinkitDrupalLink" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 97 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).

I'm using drupal 10.3.10, php 8.1, if you need to know anything else stay tuned, thank you very much

Steps to reproduce

  1. Have a text format that uses linkit and add it to the body of a content type
  2. Click on edit content
  3. Observe the aforementioned error
πŸ› Bug report
Status

Active

Version

7.0

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
  • html5

    Implements and supports the use of HTML5.

Sign in to follow issues

Comments & Activities

  • Issue created by @lejuanchis
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Thanks for the report. Given the seemingly simple steps to reproduce, and the fact that this hasn't been an issue for other sites, I'm wondering if there's something specific to your site's configuration that is involved. Would you be able to test this in a generic Drupal 10.3.10 context (e.g., site install with the "standard" profile, no additional modules installed), and see if you can reproduce it in that context? Thanks!

  • I have the same issue. The module file in 7.0 shows this line:

    /**
     * Implements hook_ckeditor_plugin_info_alter().
     */
    function linkit_ckeditor_plugin_info_alter(array &$plugins) {
      if (isset($plugins['drupallink'])) {
        $plugins['drupallink']['class'] = "Drupal\\linkit\\Plugin\\CKEditorPlugin\\LinkitDrupalLink";
      }
    }
    

    However, the plugin does not exist anymore. Can we just remove this line? I think core handles this now in ckeditor5.

    • 95b23547 committed on 7.x
      Issue #3494656: Error updating to 7.0.0: "Drupal\linkit\Plugin\...
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Ah, thanks for connecting the dots in comment #4! Yes, the 7.x version of this module drops support for CKEditor 4, and the code triggering this problem is for the CKEditor 4 integration, so it can be removed in the 7.x branch. Sites that are *only* using CKEditor 5 presumably would not have this error, just sites that still have CKEditor 4 enabled somewhere.

    Committed, and a release is forthcoming!

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson
Production build 0.71.5 2024