Issue #2837011 by johndevman, pk188: Cannot set a text format to use a text editor without settings

8.4.x
Lee Rowlands 2017-06-24 16:17:54 +10:00
parent c4b5c0dce5
commit 34debcbddc
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
1 changed files with 3 additions and 1 deletions

View File

@ -245,7 +245,9 @@ function editor_form_filter_admin_format_submit($form, FormStateInterface $form_
// Ensure the text format is set: when creating a new text format, this
// would equal the empty string.
$editor->set('format', $format_id);
$editor->setSettings($form_state->getValue(['editor', 'settings']));
if ($settings = $form_state->getValue(['editor', 'settings'])) {
$editor->setSettings($settings);
}
$editor->save();
}
}