diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 1bd768523e205c8cf3b63a99d3a4b35dc874c843..185ca8b3a0d0254052f7cf38ce16316eb2972c53 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -1132,7 +1132,7 @@ protected function getDisplayModeOptions($display_type, $entity_type_id) { } /** - * Returns an array of display mode options by bundle. + * Returns an array of enabled display mode options by bundle. * * @param $display_type * The display type to be retrieved. It can be "view_mode" or "form_mode". diff --git a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php index 8132c73ec3834416edcc2e8fbffe8000f5fd3097..edce82c7642a4778ba0b9345df4929d21fd06c0d 100644 --- a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php @@ -450,7 +450,7 @@ public function getViewModeOptions($entity_type_id); public function getFormModeOptions($entity_type_id); /** - * Returns an array of view mode options by bundle. + * Returns an array of enabled view mode options by bundle. * * @param string $entity_type_id * The entity type whose view mode options should be returned. @@ -463,7 +463,7 @@ public function getFormModeOptions($entity_type_id); public function getViewModeOptionsByBundle($entity_type_id, $bundle); /** - * Returns an array of form mode options by bundle. + * Returns an array of enabled form mode options by bundle. * * @param string $entity_type_id * The entity type whose form mode options should be returned. diff --git a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php index e32d73be86c27f8ed4210ebfec920db7a6306669..6681f61804fb5bf562e0fe1b68eaf3d23aa88c75 100644 --- a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php +++ b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php @@ -211,8 +211,8 @@ public function form(array $form, FormStateInterface $form_state) { ); // Prepare default values for the 'Custom display settings' checkboxes. $default = array(); - if ($display_statuses = array_filter($this->getDisplayStatuses())) { - $default = array_keys(array_intersect_key($display_mode_options, $display_statuses)); + if ($enabled_displays = array_filter($this->getDisplayStatuses())) { + $default = array_keys(array_intersect_key($display_mode_options, $enabled_displays)); } $form['modes']['display_modes_custom'] = array( '#type' => 'checkboxes',