diff --git a/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/SelectionBase.php b/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/SelectionBase.php index 07ec8cd16cb57b333fd53734ab2d3006df1e4df9..f33fe2ac7d5a87d4b6b17309a44668545728bd79 100644 --- a/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/SelectionBase.php +++ b/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/SelectionBase.php @@ -124,18 +124,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta $bundle_options[$bundle_name] = $bundle_info['label']; } - $target_bundles_title = $this->t('Bundles'); - // Default core entity types with sensible labels. - if ($entity_type_id == 'node') { - $target_bundles_title = $this->t('Content types'); - } - elseif ($entity_type_id == 'taxonomy_term') { - $target_bundles_title = $this->t('Vocabularies'); - } - $form['target_bundles'] = array( '#type' => 'checkboxes', - '#title' => $target_bundles_title, + '#title' => $this->t('Bundles'), '#options' => $bundle_options, '#default_value' => (!empty($selection_handler_settings['target_bundles'])) ? $selection_handler_settings['target_bundles'] : array(), '#required' => TRUE, diff --git a/core/modules/node/src/Plugin/EntityReferenceSelection/NodeSelection.php b/core/modules/node/src/Plugin/EntityReferenceSelection/NodeSelection.php index b5db19ab68a1b2ac14f599a7d5c1315e50260662..c2b6f3a09460ece796989167a5928a91575e023e 100644 --- a/core/modules/node/src/Plugin/EntityReferenceSelection/NodeSelection.php +++ b/core/modules/node/src/Plugin/EntityReferenceSelection/NodeSelection.php @@ -8,6 +8,7 @@ namespace Drupal\node\Plugin\EntityReferenceSelection; use Drupal\Core\Entity\Plugin\EntityReferenceSelection\SelectionBase; +use Drupal\Core\Form\FormStateInterface; /** * Provides specific access control for the node entity type. @@ -22,6 +23,15 @@ */ class NodeSelection extends SelectionBase { + /** + * {@inheritdoc} + */ + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { + $form = parent::buildConfigurationForm($form, $form_state); + $form['target_bundles']['#title'] = $this->t('Content types'); + return $form; + } + /** * {@inheritdoc} */ diff --git a/core/modules/taxonomy/src/Plugin/EntityReferenceSelection/TermSelection.php b/core/modules/taxonomy/src/Plugin/EntityReferenceSelection/TermSelection.php index 9bb31b124af1a2b8cc07bb3542c6d79e6aa87234..61281fb992c36afe12ffd5ee34ed5942bbcb3331 100644 --- a/core/modules/taxonomy/src/Plugin/EntityReferenceSelection/TermSelection.php +++ b/core/modules/taxonomy/src/Plugin/EntityReferenceSelection/TermSelection.php @@ -39,6 +39,7 @@ public function entityQueryAlter(SelectInterface $query) { public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form = parent::buildConfigurationForm($form, $form_state); + $form['target_bundles']['#title'] = $this->t('Vocabularies'); // @todo: Currently allow auto-create only on taxonomy terms. $form['auto_create'] = array( '#type' => 'checkbox',