Discovered while working on #3245320: Automatic upgrade path always disables image uploads β in the UI β .
Root cause:
editor_form_filter_admin_format_editor_configure()
does
elseif (empty($editor) || $editor_value !== $editor->getEditor()) {
$format = $form_state->getFormObject()->getEntity();
$editor = Editor::create([
'format' => $format->isNew() ? NULL : $format->id(),
'editor' => $editor_value,
]);
$form_state->set('editor', $editor);
}
It's that second condition that allows entering this branch that is true when switching the text editor. While text-editor specific settings cannot be carried over, image upload settings can be, because they're embedded in the Editor
config entity at the top-level, and they even have an API interface: \Drupal\editor\EditorInterface::getImageUploadSettings()
+ \Drupal\editor\EditorInterface::setImageUploadSettings()
.
Switch the default Basic HTML text format to use CKEditor 5 and observe the image uploads setting getting turned off.
Carry over image upload settings when switching text editor.
None.
None.
None.
None.
Needs work
11.0 π₯
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.