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
Comments
Comment #2
cilefen commentedThat 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?
Comment #3
gauravvvv commentedUpdated the issue summary with steps to reproduce
Comment #4
gauravvvv commentedComment #6
gauravvvv commentedComment #7
cilefen commentedShould the Boolean expression be
!isset($image_upload_settings['status']) || !$image_upload_settings['status']instead?Comment #8
smustgrave commentedLike 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.
Comment #9
cilefen commentedComment #10
fvd commentedI 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)
Comment #12
rajeshreeputrastatic patch for 11.0.1 version.
Comment #13
mortona2k commentedI 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)
Comment #16
jaydee1818 commentedI experienced the same issue.
Comment #17
liam morlandeditor_form_filter_admin_format_submit()is in11.xbut has been removed frommain; see #3568092: Convert editor.module procedural submit, validate and Ajax callbacks to methods.