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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3265233-2.patch | 576 bytes | lendude |
Comments
Comment #2
lendudeSince 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.
Comment #3
anneke_vde commentedAgreed, with above patch I have no notices anymore.
Comment #4
batkorPatch for 8.x-1.x
Comment #5
joelpittetHiding patch in #4 so it doesn't get confused with the RTBC'd patch for 2.x branch.
Comment #6
joelpittetComment #8
snater commentedThanks for the patch! I'm sorry for taking so long to merge it in.