Commit 0396fa2c authored by marcvangend's avatar marcvangend

read default value from thirdpartysettings

parent 435cc0df
......@@ -20,9 +20,8 @@ function fieldblock_form_field_ui_display_overview_form_alter(&$form, &$form_sta
$bundle = $form['#bundle'];
$mode = $form['#mode'];
$config_name = 'fieldblock.' . $entity_type .'.'. $bundle;
$config = \Drupal::config($config_name);
$settings = $config->get($mode);
/** @var \Drupal\Core\Entity\EntityDisplayModeInterface $view_mode_config */
$view_mode_config = EntityViewDisplay::load($entity_type . '.' . $bundle . '.' . $mode);
// Add a column header.
$form['fields']['#header'][] = t('Display as block');
......@@ -32,7 +31,7 @@ function fieldblock_form_field_ui_display_overview_form_alter(&$form, &$form_sta
foreach ($field_names as $field_name) {
$form['fields'][$field_name]['fieldblock'] = array(
'#type' => 'checkbox',
'#default_value' => isset($settings[$field_name]) ? true : false,
'#default_value' => $view_mode_config->getThirdPartySetting('fieldblock', $field_name) ? true : false,
'#title' => '',
);
}
......
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