Problem/Motivation

Cloned from #3210241: Notice: Undefined index: drupalExternalPlugins in insert_editor_js_settings_alter() (line 830 of modules/contrib/insert/insert.module). but shouldn't have been.

Other Text editors than CKeditor do not have drupalExternalPlugins array key (like the Guterberg editor), which is tested by Insert module. This is causing following warning message: Notice: Undefined index: drupalExternalPlugins in insert_editor_js_settings_alter() (line 830 of modules/contrib/insert/insert.module).

Steps to reproduce

In my case I was testing Test editor: Editor.md, but it seems that others have also similar problem:
Ace Code Editor https://www.drupal.org/project/ace_editor/issues/3030411
Gutenberg https://www.drupal.org/project/gutenberg/issues/3058842
When selected Editor.md, then on the field settings (type Text (formatted, long)) warning message is displayed.

Proposed resolution

In function insert_editor_js_settings_alter() test if this key exists 'drupalExternalPlugins'.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#4 3265233-8.1-dev.patch848 bytesbatkor
#2 3265233-2.patch576 byteslendude

Comments

Lendude created an issue. See original summary.

lendude’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new576 bytes

Since the only key that is used in the subsequent code is 'drupalExternalPlugins', we can just check for that key in the existing isset(), since it doesn't matter is the parent key is set I think.

So here is a patch that does that.

anneke_vde’s picture

Status: Needs review » Reviewed & tested by the community

Agreed, with above patch I have no notices anymore.

batkor’s picture

StatusFileSize
new848 bytes

Patch for 8.x-1.x

joelpittet’s picture

Hiding patch in #4 so it doesn't get confused with the RTBC'd patch for 2.x branch.

joelpittet’s picture

Title: Notice: Undefined index: drupalExternalPlugins in insert_editor_js_settings_alter() (line 830 of modules/contrib/insert/insert.module). » Notice: Undefined index: drupalExternalPlugins in insert_editor_js_settings_alter()

  • Snater committed d35524a0 on 8.x-2.x authored by Lendude
    Issue #3265233 by Lendude: Notice: Undefined index:...
snater’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch! I'm sorry for taking so long to merge it in.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.