Skip to content
Snippets Groups Projects
Unverified Commit e94c8af3 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3136406 by Spokje, codersukanta, IJsbrandy, atul4drupal, MahtabAlam,...

Issue #3136406 by Spokje, codersukanta, IJsbrandy, atul4drupal, MahtabAlam, BalajiDS: Argument 1 passed to Drupal\Core\Form\SubformState::createForSubform() must be of the type array, null given

(cherry picked from commit acb4b855)
parent 0e1bcea3
No related branches found
No related tags found
8 merge requests!1445Issue #2920039: Views' User Name exposed group filter validation,!1298Issue #3240993: Let layout builder render inline block translations,!774Issue #3174569: Example node template file name is incorrect,!497Issue #2463967: Use .user.ini file for PHP settings,!433Resolve #3163663 "Too many open files",!233Resolve #2693787 "Taxonomy term name",!133Resolve #2666286 "Clean up menuui",!112Resolve #3187004 "Drupaldatetime serialization issue"
......@@ -247,7 +247,9 @@ function editor_form_filter_admin_format_submit($form, FormStateInterface $form_
$original_editor->delete();
}
if ($editor_plugin = $form_state->get('editor_plugin')) {
$editor_set = $form_state->getValue(['editor', 'editor']) !== "";
$subform_array_exists = (!empty($form['editor']['settings']['subform']) && is_array($form['editor']['settings']['subform']));
if (($editor_plugin = $form_state->get('editor_plugin')) && $editor_set && $subform_array_exists) {
$subform_state = SubformState::createForSubform($form['editor']['settings']['subform'], $form, $form_state);
$editor_plugin->submitConfigurationForm($form['editor']['settings']['subform'], $subform_state);
}
......
......@@ -155,6 +155,23 @@ public function testDisableFormatWithEditor() {
$this->assertRaw($text);
}
/**
* Tests switching text editor to none does not throw a TypeError.
*/
public function testSwitchEditorToNone() {
$this->enableUnicornEditor();
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/config/content/formats/manage/filtered_html');
$edit = $this->selectUnicornEditor();
// Switch editor to 'None'.
$edit = [
'editor[editor]' => '',
];
$this->submitForm($edit, 'Configure');
$this->submitForm($edit, 'Save configuration');
}
/**
* Adds an editor to a new format using the UI.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment