Problem/Motivation

After setup CKeditor5 as text editor in Drupal 10.3
i get this error

Undefined array key "status" in editor_form_filter_admin_format_submit() (line 257 of core/modules/editor/editor.module).
editor_form_filter_admin_format_submit(Array, Object)
call_user_func_array('editor_form_filter_admin_format_submit', Array) (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('filter_format_edit_form', Array, Object) (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

1. Go to admin/config/content/formats page
2. Add a text format
3. Use CKeditor 5 as text editor
4. Save your changes
5. You will see a successful message for the text format and one error message with the warning 'Undefined array key'.

Proposed resolution

TBD

Issue fork drupal-3457717

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

trickfun created an issue. See original summary.

cilefen’s picture

Component: ckeditor5.module » editor.module

That means the editor settings on the form is not posting data about image upload settings. However, the form processing code doesn't carefully check this. Is this warning causing any functional problem on that site? Is the form modified by a custom or contributed module?

gauravvvv’s picture

Issue summary: View changes

Updated the issue summary with steps to reproduce

gauravvvv’s picture

Version: 10.3.x-dev » 11.x-dev

gauravvvv’s picture

Status: Active » Needs review
cilefen’s picture

Should the Boolean expression be !isset($image_upload_settings['status']) || !$image_upload_settings['status'] instead?

smustgrave’s picture

Status: Needs review » Needs work

Like the 3rd issue I've had to post this

But for these kind of issue research needs to be done about why the field is empty. Putting just a check makes the warning go away but could be masking a larger issue.

cilefen’s picture

fvd’s picture

I have the same message: Warning: Undefined array key "status" in editor_form_filter_admin_format_submit() (line 257 of /web/core/modules/editor/editor.module)

as I add a text format there: /admin/config/content/formats/

The message comes from /admin/reports/dblog

(Drupal core 10.3.1 php 8.3)

rajeshreeputra made their first commit to this issue’s fork.

rajeshreeputra’s picture

static patch for 11.0.1 version.

mortona2k’s picture

I had some formatters configured with Ace Editor that were throwing this warning.

The config was exporting as:

image_upload: {}

The part that throws the warning is setting empty values to status: false, so I think it's either an intentional warning that some config is bad, or a false warning on an empty value.

Is it an editor config's responsibility to set image_upload: {status: false} ?

(looking at editor.schema.yml, it appears so)

joelpittet made their first commit to this issue’s fork.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

jaydee1818’s picture

I experienced the same issue.

liam morland’s picture

Version: main » 11.x-dev

editor_form_filter_admin_format_submit() is in 11.x but has been removed from main; see #3568092: Convert editor.module procedural submit, validate and Ajax callbacks to methods.