// 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();
}
}
* @param \Drupal\filter\FilterFormatInterface|null $format
* The text format whose text editor will be used or NULL if the previously
* defined text format is now disabled.
- * @param \Drupal\filter\FilterFormatInterface $original_format|null
+ * @param \Drupal\filter\FilterFormatInterface|null $original_format
* (optional) The original text format (i.e. when switching text formats,
* $format is the text format that is going to be used, $original_format is
* the one that was being used initially, the one that is stored in the
*
* @param array $uuids
* An array of file entity UUIDs.
- * @param EntityInterface $entity
+ * @param \Drupal\Core\Entity\EntityInterface $entity
* An entity whose fields to inspect for file references.
*/
function _editor_record_file_usage(array $uuids, EntityInterface $entity) {
*
* @param array $uuids
* An array of file entity UUIDs.
- * @param EntityInterface $entity
+ * @param \Drupal\Core\Entity\EntityInterface $entity
* An entity whose fields to inspect for file references.
* @param $count
* The number of references to delete. Should be 1 when deleting a single
/**
* Finds all files referenced (data-entity-uuid) by formatted text fields.
*
- * @param EntityInterface $entity
+ * @param \Drupal\Core\Entity\EntityInterface $entity
* An entity whose fields to analyze.
*
* @return array