diff --git a/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php index 2ec5fc6..f5c01a9 100644 --- a/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -391,7 +391,9 @@ protected function submitEntityLanguage(array $form, array &$form_state) { */ public function buildEntity(array $form, array &$form_state) { $entity = clone $this->entity; - // The form state might still have an form controller before form caching. + // If you submit a form, the form state comes from caching, which forces + // the controller to be the one before caching. Ensure to have the + // controller of the current request. $form_state['controller'] = $this; // @todo Move entity_form_submit_build_entity() here. // @todo Exploit the Field API to process the submitted entity field. diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php index d25e547..f9d4965 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php @@ -60,7 +60,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ */ public function form(array $form, array &$form_state) { $format = $this->entity; - $is_fallback = ($format->id() == filter_fallback_format()); + $is_fallback = ($format->id() == $this->configFactory->get('filter.settings')->get('fallback_format')); $form['#tree'] = TRUE; $form['#attached']['library'][] = array('filter', 'drupal.filter.admin'); diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php b/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php index f7649b0..43c4940 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php @@ -97,7 +97,8 @@ public function load() { public function buildForm(array $form, array &$form_state) { // Overview of all formats. $this->entities = $this->load(); - $fallback_format = filter_fallback_format(); + $filter_settings = $this->configFactory->get('filter.settings'); + $fallback_format = $filter_settings->get('fallback_format'); $form['#tree'] = TRUE; $form['formats'] = array( @@ -107,7 +108,7 @@ public function buildForm(array $form, array &$form_state) { array('order', 'sibling', 'text-format-order-weight'), ), ); - $fallback_choice = $this->configFactory->get('filter.settings')->get('always_show_fallback_choice'); + $fallback_choice = $filter_settings->get('always_show_fallback_choice'); foreach ($this->entities as $id => $format) { $form['formats'][$id]['#attributes']['class'][] = 'draggable'; $form['formats'][$id]['#weight'] = $format->weight;