Undefined array key "drupallink"

Created on 15 March 2024, 9 months ago
Updated 5 April 2024, 9 months ago

Problem/motivation

I have a custom module that provides config for valid text formats on my site. This module has a few dependencies including ckeditor5 and linkit. It includes a basic functional test which has been failing due to this error:

Exception: Warning: Undefined array key "drupallink" linkit_form_editor_link_dialog_alter()() (Line: 65)

That line inside of linkit.module shows this:
$plugin_settings = $editor->getSettings()['plugins']['drupallink'];

Before I upgraded to CKEditor5, the config for my text editor showed this:

settings:
  plugins:
    drupallink:
      linkit_enabled: true
      linkit_profile: profile_name_here

However after CKEditor5, the drupallink key no longer exists. The config is now:

settings:
  plugins:
    linkit_extension:
      linkit_enabled: true
      linkit_profile: profile_name_here

So this undefined array key error makes sense to me. Am I missing something here? Or does line 65 of linkit.module need to be updated to also check for linkit_extension?

Thanks!

🐛 Bug report
Status

Closed: works as designed

Version

6.1

Component

Code

Created by

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

Comments & Activities

  • Issue created by @tlo405
  • Status changed to Closed: works as designed 9 months ago
  • My apologies, I realized that the functional test I had written previously was still trying to hit /editor/dialog/link/rich_text. This was calling linkit_form_editor_link_dialog_alter() which otherwise wouldn't be getting called. The old ckeditor was showing a form in a modal (the actual form URL being /editor/dialog/link/rich_text but the new ckeditor5 is doing it differently.

Production build 0.71.5 2024