diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermViewBuilder.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermViewBuilder.php index 27efd9f92137bbd65f26b4a777d22a4d1c9d6d3d..1eb21f0797c1b570f5bfcf2b033823154938994e 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermViewBuilder.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermViewBuilder.php @@ -37,19 +37,6 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang } } - /** - * {@inheritdoc} - */ - protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) { - $return = parent::getBuildDefaults($entity, $view_mode, $langcode); - - // TODO: rename "term" to "taxonomy_term" in theme_taxonomy_term(). - $return['#term'] = $return["#{$this->entityTypeId}"]; - unset($return["#{$this->entityTypeId}"]); - - return $return; - } - /** * {@inheritdoc} */ diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index bc7b30b6b6099f82abaa202f71d86d2c8e89c923..9b72023b69a9189fee0d2b08f6b97c5302dbdb7a 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -372,7 +372,8 @@ function taxonomy_term_view_multiple(array $terms, $view_mode = 'full', $langcod function taxonomy_theme_suggestions_taxonomy_term(array $variables) { $suggestions = array(); - $term = $variables['elements']['#term']; + /** @var \Drupal\taxonomy\TermInterface $term */ + $term = $variables['elements']['#taxonomy_term']; $suggestions[] = 'taxonomy_term__' . $term->bundle(); $suggestions[] = 'taxonomy_term__' . $term->id(); @@ -389,14 +390,15 @@ function taxonomy_theme_suggestions_taxonomy_term(array $variables) { * An associative array containing: * - elements: An associative array containing the taxonomy term and any * fields attached to the term. Properties used: - * - #term: The term object. + * - #taxonomy_term: A \Drupal\taxonomy\TermInterface object. * - #view_mode: The current view mode for this taxonomy term, e.g. * 'full' or 'teaser'. * - attributes: HTML attributes for the containing element. */ function template_preprocess_taxonomy_term(&$variables) { $variables['view_mode'] = $variables['elements']['#view_mode']; - $variables['term'] = $variables['elements']['#term']; + $variables['term'] = $variables['elements']['#taxonomy_term']; + /** @var \Drupal\taxonomy\TermInterface $term */ $term = $variables['term']; $variables['url'] = $term->url();