diff --git a/core/modules/taxonomy/config/views.view.taxonomy_term.yml b/core/modules/taxonomy/config/views.view.taxonomy_term.yml index 2e3dc0c..cfc0594 100644 --- a/core/modules/taxonomy/config/views.view.taxonomy_term.yml +++ b/core/modules/taxonomy/config/views.view.taxonomy_term.yml @@ -54,6 +54,7 @@ display: type: taxonomy_term depth: '0' break_phrase: '1' + set_breadcrumb: '1' term_node_tid_depth_modifier: id: term_node_tid_depth_modifier table: node diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 02d7a1d..9ffe995 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -9,7 +9,6 @@ use Drupal\taxonomy\Plugin\Core\Entity\Term; use Drupal\taxonomy\Plugin\Core\Entity\Vocabulary; use Drupal\Core\Entity\EntityInterface; -use Drupal\views\ViewExecutable; /** * Denotes that no term in the vocabulary has a parent. @@ -1528,27 +1527,3 @@ function taxonomy_library_info() { return $libraries; } - -/** - * Implements hook_views_pre_view(). - * - * @todo This hack used to live in taxonomy_term_page() with the following - * comment: This overrides any other possible breadcrumb and is a pure - * hard-coded presumption. Make this behavior configurable per vocabulary or - * term. - */ -function taxonomy_views_pre_view(ViewExecutable $view, &$display_id, array &$args) { - if ($view->storage->get('name') == 'taxonomy_term') { - $breadcrumb = array(); - $current = (object) array( - 'tid' => reset($args), - ); - while ($parents = taxonomy_term_load_parents($current->tid)) { - $current = array_shift($parents); - $breadcrumb[] = l($current->label(), 'taxonomy/term/' . $current->tid); - } - $breadcrumb[] = l(t('Home'), NULL); - $breadcrumb = array_reverse($breadcrumb); - drupal_set_breadcrumb($breadcrumb); - } -} diff --git a/core/modules/taxonomy/taxonomy.views.inc b/core/modules/taxonomy/taxonomy.views.inc index c44037d..874553f 100644 --- a/core/modules/taxonomy/taxonomy.views.inc +++ b/core/modules/taxonomy/taxonomy.views.inc @@ -484,7 +484,7 @@ function views_taxonomy_set_breadcrumb(&$breadcrumb, &$argument) { } $args = $argument->view->args; - $parents = taxonomy_get_parents_all($argument->argument); + $parents = taxonomy_term_load_parents($argument->argument); foreach (array_reverse($parents) as $parent) { // Unfortunately parents includes the current argument. Skip. if ($parent->tid == $argument->argument) {