Commit ba11b094 authored by alexpott's avatar alexpott

Issue #2590605 by yched: Followup for [#2322503]

parent 19adf844
...@@ -1132,7 +1132,7 @@ protected function getDisplayModeOptions($display_type, $entity_type_id) { ...@@ -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 * @param $display_type
* The display type to be retrieved. It can be "view_mode" or "form_mode". * The display type to be retrieved. It can be "view_mode" or "form_mode".
......
...@@ -450,7 +450,7 @@ public function getViewModeOptions($entity_type_id); ...@@ -450,7 +450,7 @@ public function getViewModeOptions($entity_type_id);
public function getFormModeOptions($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 * @param string $entity_type_id
* The entity type whose view mode options should be returned. * The entity type whose view mode options should be returned.
...@@ -463,7 +463,7 @@ public function getFormModeOptions($entity_type_id); ...@@ -463,7 +463,7 @@ public function getFormModeOptions($entity_type_id);
public function getViewModeOptionsByBundle($entity_type_id, $bundle); 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 * @param string $entity_type_id
* The entity type whose form mode options should be returned. * The entity type whose form mode options should be returned.
......
...@@ -211,8 +211,8 @@ public function form(array $form, FormStateInterface $form_state) { ...@@ -211,8 +211,8 @@ public function form(array $form, FormStateInterface $form_state) {
); );
// Prepare default values for the 'Custom display settings' checkboxes. // Prepare default values for the 'Custom display settings' checkboxes.
$default = array(); $default = array();
if ($display_statuses = array_filter($this->getDisplayStatuses())) { if ($enabled_displays = array_filter($this->getDisplayStatuses())) {
$default = array_keys(array_intersect_key($display_mode_options, $display_statuses)); $default = array_keys(array_intersect_key($display_mode_options, $enabled_displays));
} }
$form['modes']['display_modes_custom'] = array( $form['modes']['display_modes_custom'] = array(
'#type' => 'checkboxes', '#type' => 'checkboxes',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment