$form_item_name =
static::
mapPairViolationPropertyPathsToFormNames($violation->
getPropertyPath(),
$form);
// When adding a toolbar item, it is possible that not all conditions for
// using it have been met yet. FormBuilder refuses to rebuild forms when a
// validation error is present. But to meet the condition for the toolbar
// item, configuration must be set in a vertical tab that must still
// appear. Work-around: reduce the validation error to a warning message.
// @see \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemConditionsMetConstraintValidator
if ($form_state->
isRedirectDisabled() &&
$form_item_name === 'editor][settings][toolbar][items'
) { $this->
messenger()->
addWarning($violation->
getMessage());
continue;
} $form_state->
getCompleteFormState()->
setErrorByName($form_item_name,
$violation->
getMessage());
} // Pass it on to ::submitConfigurationForm().
$form_state->
get('editor'
)->
setSettings($settings);
// Provide the validated eventual pair in form state to
// ::getGeneratedAllowedHtmlValue(), to update filter_html's
// "allowed_html".
$form_state->
set('ckeditor5_validated_pair',
$eventual_editor_and_format);
assert(TRUE ===
$this->
checkConfigSchema(\Drupal::
getContainer()->
get('config.typed'
), 'editor.editor.id_does_not_matter',
$submitted_editor->
toArray()), 'Schema errors: ' .
print_r($this->
checkConfigSchema(\Drupal::
getContainer()->
get('config.typed'
), 'editor.editor.id_does_not_matter',
$submitted_editor->
toArray()), TRUE
));
}