Problem/Motivation
Other Text editors than CKeditor do not have drupalExternalPlugins array key, 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 :
if (isset($settings['editor']['formats'][$text_format_id]['editorSettings']['drupalExternalPlugins']) && !in_array(
'drupalimage',
array_keys($settings['editor']['formats'][$text_format_id]['editorSettings']['drupalExternalPlugins'])
)) {
Comments
Comment #2
neslee canil pinto@Bohus Ulrych this issue is fixed in #3103930: in_array() expects parameter 2 to be array, will make a new release soon
Comment #4
bohus ulrychHi again, maybe it is related, but not same.
In #3103930 is introduced new validation for
$settings['editor']['formats'][$text_format_id]['editorSettings']but my error is little bit different, and it is fixed with this validation
$settings['editor']['formats'][$text_format_id]['editorSettings']['drupalExternalPlugins']Thanks
Comment #5
promo-il commented8.x-2.x-dev updated 24 May 2021 (Drupal Version: 8.9.15, PHP:7.2)