diff --git a/core/modules/contact/lib/Drupal/contact/CategoryListController.php b/core/modules/contact/lib/Drupal/contact/CategoryListController.php index 9ac2c22..4a2d9cb 100644 --- a/core/modules/contact/lib/Drupal/contact/CategoryListController.php +++ b/core/modules/contact/lib/Drupal/contact/CategoryListController.php @@ -121,24 +121,18 @@ public function buildForm(array $form, array &$form_state) { $row['recipients'] = array( '#markup' => $row['recipients'], ); - if ($entity->id() == 'personal') { + // Allow to change default contact category. + $row['default'] = array( + '#type' => 'radio', + '#title' => t('Set @title as default', array('@title' => $entity->label())), + '#title_display' => 'invisible', + '#return_value' => $entity->id(), + '#default_value' => ($default_category == $entity->id() ? $entity->id() : NULL), + '#parents' => array('default_category'), + '#id' => 'edit-entities-default', // Personal category could not be set default. - $row['default'] = array( - '#markup' => '', - ); - } - else { - // Allow to change default contact category. - $row['default'] = array( - '#type' => 'radio', - '#title' => t('Set @title as default', array('@title' => $entity->label())), - '#title_display' => 'invisible', - '#return_value' => $entity->id(), - '#default_value' => ($default_category == $entity->id() ? $entity->id() : NULL), - '#parents' => array('default_category'), - '#id' => 'edit-entities-default', - ); - } + '#access' => $entity->id() != 'personal', + ); // Add weight column and ordering. $row['#weight'] = $entity->get('weight'); $row['#attributes']['class'][] = 'draggable';