Editing pages returns an array_keys error

Created on 16 March 2023, almost 2 years ago
Updated 17 March 2023, almost 2 years ago

Problem/Motivation

I'm on 9.5.5 and preparing for the v10 upgrade. I installed CKEditor 5 and now when I try to edit a page, I get the following error:

TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in array_keys() (line 833 of modules/insert/insert.module).

array_keys() (Line: 833)
insert_editor_js_settings_alter() (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter() (Line: 88)
Drupal\editor\Plugin\EditorManager->getAttachments() (Line: 100)
Drupal\editor\Element->preRenderTextFormat()
call_user_func_array() (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 788)
Drupal\Core\Render\Renderer->doCallback() (Line: 374)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 89)
__TwigTemplate_2f29938d564cf6145ff8f2435a9c4fef->doDisplay() (Line: 405)
Twig\Template->displayWithErrorHandling() (Line: 378)
Twig\Template->display() (Line: 390)
Twig\Template->render() (Line: 55)
twig_render_template() (Line: 384)
Drupal\Core\Theme\ThemeManager->render() (Line: 433)
Drupal\Core\Render\Renderer->doRender() (Line: 446)
Drupal\Core\Render\Renderer->doRender() (Line: 446)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 44)
__TwigTemplate_c1581384d48d0003c2383dad12403960->doDisplay() (Line: 405)
Twig\Template->displayWithErrorHandling() (Line: 378)
Twig\Template->display() (Line: 390)
Twig\Template->render() (Line: 55)
twig_render_template() (Line: 384)
Drupal\Core\Theme\ThemeManager->render() (Line: 433)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 243)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 718)
Drupal\Core\DrupalKernel->handle() (Line: 19)

And when I go back to "Text formats and editors", I get this error:

 Warning: Undefined array key "drupalExternalPlugins" in insert_editor_js_settings_alter() (line 833 of modules/insert/insert.module).

insert_editor_js_settings_alter(Array, NULL, NULL) (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter('editor_js_settings', Array) (Line: 88)
Drupal\editor\Plugin\EditorManager->getAttachments(Array) (Line: 100)
Drupal\editor\Element->preRenderTextFormat(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 89)
__TwigTemplate_2f29938d564cf6145ff8f2435a9c4fef->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('core/themes/claro/templates/form/field-multiple-value-form.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field_multiple_value_form', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 44)
__TwigTemplate_c1581384d48d0003c2383dad12403960->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('core/themes/claro/templates/node-edit-form.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node_edit_form', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 243)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

  1. Uninstalled codesnippet and resize modules.
  2. Installed CKEditor 5.
  3. Went to "Text formats and editors" and changed each format to use v5.
  4. Uninstalled CKEditor 4.
  5. Cleared all caches.
  6. Picked a page at random and edited it and got the aforementioned error. All other pages I've tried return the same error.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Closed: works as designed

Version

9.5

Component
CKEditor 5 

Last updated about 19 hours ago

Created by

🇺🇸United States chanelwheeler

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

Comments & Activities

  • Issue created by @chanelwheeler
  • Status changed to Postponed: needs info almost 2 years ago
  • At a glance this issue appears to involve the insert module not being compatible with CKEditor 5. There is an issue for that: 📌 CKEditor 5 compatibility Active .

    Does uninstalling the Insert module fix the problem?

  • Status changed to Active almost 2 years ago
  • 🇺🇸United States chanelwheeler

    I uninstalled and it did fix the problem. Thank you. I dug around some more and found that I should be using the media library. I got that set up and it's too clever for its own good. I have lists of bulleted links -- the media library puts in extra text and formatting. I also need to be able to upload more formats than the media library allows and I don't see any way to change that.

  • Status changed to Closed: works as designed almost 2 years ago
  • As a major-priority bug against Drupal Core, I am closing this. Use the support resources for questions about Media. I recommend Slack in the #support channel.

Production build 0.71.5 2024