Delete config action does not completely delete nested arrays

Created on 24 September 2023, about 1 year ago
Updated 6 December 2023, 12 months ago

Problem/Motivation

I'm in the process of enabling ckeditor5 for a distribution. When I am in the step of testing the configuration updates generated from this module, I encountered an issue regarding config validation on the ckeditor5 config. Upon some debugging, I saw that the following part (under settings.toolbar) existed in the configuration of ckeditor5, but it shouldn't be

    rows:
      -
        -
          items: {  }
        -
          items: {  }
        -
          items: {  }
        -
          items: {  }
        -
          items: {  }
        -
          items: {  }
        -
          items: {  }

The culprit is here. The "NestedArray::unsetValue()" does not unset the parent keys, producing this problem

Steps to reproduce

Proposed resolution

In "Updater::getFlatKeys()", provide also the parent array so that everything can be deleted by "NestedArray::unsetValue()"

Config validation error:

The website encountered an unexpected error. Please try again later.
AssertionError: Schema errors: Array ( [editor.editor.id_does_not_matter:settings.toolbar.rows] => missing schema ) in assert() (line 729 of core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php).

assert(, 'Schema errors: Array
(
    [editor.editor.id_does_not_matter:settings.toolbar.rows] => missing schema
)
') (Line: 729)
Drupal\ckeditor5\Plugin\Editor\CKEditor5->validateConfigurationForm(Array, Object) (Line: 211)
editor_form_filter_admin_format_validate(Array, Object)
call_user_func_array('editor_form_filter_admin_format_validate', Array) (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 275)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'filter_format_edit_form') (Line: 118)
Drupal\Core\Form\FormValidator->validateForm('filter_format_edit_form', Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('filter_format_edit_form', Array, Object) (Line: 325)
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: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
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)

πŸ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡¬πŸ‡·Greece dimitriskr

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024