From \Drupal\taxonomy\TermBreadcrumbBuilder::build()

// @todo This overrides any other possible breadcrumb and is a pure hard-coded
//   presumption. Make this behavior configurable per vocabulary or term.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhedstrom’s picture

Status: Active » Needs review
FileSize
1.57 KB

This patch doesn't make the behavior configurable, but it fixes the issue where taxonomy_term_page() was overriding breadcrumbs that had already been set by another module.

jhedstrom’s picture

Oops. Had the logic backwards there.

Sborsody’s picture

For what it's worth, reposting my opinion on breadcrumbs from http://drupal.org/node/723694#comment-3061402

I realize this is part of the larger discussion regarding how Drupal does breadcrumbs. My opinion is that individual modules (taxonomy, blog, book, forum, etc.) probably shouldn't be doing the actual setting of breadcrumbs but only return a breadcrumb when asked. Then let the theme designer handle choosing breadcrumbs at the theme level. Or in other words, theme_breadcrumb() is your last chance to modify the breadcrumb before it is rendered!

The patch in #2 is a good start. The only drawback is that there's no way to get a taxonomy breadcrumb without unsetting whatever is currently set. It would be infinitely useful if modules returned a breadcrumb or part of a breadcrumb to a caller.

andypost’s picture

firebird’s picture

Here's a patch that allows switching the taxonomy module defined breadcrumbs on/off per vocabulary. This allows the use of any custom breadcrumbs on taxonomy term pages without them getting overridden.

Status: Needs review » Needs work

The last submitted patch, taxonomy-1495510-breadcrumb_overrides-5.patch, failed testing.

firebird’s picture

The tests fail, seemingly because of the database schema change. What should I do to remedy that?

jibran’s picture

Version: 8.0.x-dev » 7.x-dev
Issue summary: View changes
Status: Needs work » Active

This is not a problem in D8 anymore we can service with high priority and override the behavior

services:
  taxonomy_term.breadcrumb:
    class: Drupal\taxonomy\TermBreadcrumbBuilder
    arguments: ['@entity.manager']
    tags:
      - { name: breadcrumb_builder, priority: 1002 }

taxonomy_term_page page is also converted to view in D8.
So moving to D7.

jibran’s picture

Title: taxonomy_term_page overrides any possible breadcrumb » TermBreadcrumbBuilder::build() overrides any possible breadcrumb
Version: 7.x-dev » 8.0.x-dev
Issue summary: View changes
Status: Active » Needs work
Issue tags: +Needs reroll, +Needs backport to D7
Related issues: +#1905370: Add missing vocabulary to fix term edit form breadcrumbs, +#2400543: Breadcrumb should be term name instead of term id on term edit and delete page

The @todo is moved to \Drupal\taxonomy\TermBreadcrumbBuilder::build()

  /**
   * {@inheritdoc}
   */
  public function build(RouteMatchInterface $route_match) {
    $term = $route_match->getParameter('taxonomy_term');
    // @todo This overrides any other possible breadcrumb and is a pure
    //   hard-coded presumption. Make this behavior configurable per
    //   vocabulary or term.

This is still an issue in D8 so moving back to D8 queue.
#1905370: Add missing vocabulary to fix term edit form breadcrumbs and #2400543: Breadcrumb should be term name instead of term id on term edit and delete page are also related.

dawehner’s picture

Mh, any contrib module can just remove the service and be done or replace the service or what not, or even just use a higher priority.

I don't see that as an implementation problem, and we don't need configuration per vocabulary, as this seems to be quite a limited usecase, if you have hierarchy, you
want it to be present.

jibran’s picture

That what I said in #8 but we need a patch here anyway to remove the @todo if we are not going to fix it. Or we can update the comment for contrib modules.

andypost’s picture

Category: Bug report » Task
Status: Needs work » Needs review
Issue tags: +Documentation
FileSize
1.87 KB

We have another implementation in forum module already so let's just link them.
So it's not a bug for 8.x

Suppose we just need them, or maybe extend comment

jibran’s picture

Awesome. We now need a beta eval.

siva_epari’s picture

Issue tags: -Needs reroll

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

stefan.korn’s picture

I came across this ToDo and wanted to use the Default Path Based Breadcrumb Builder on Taxonomy terms too.

As I understand from this issue, the ToDo is not going to be done in Drupal 8 Core. So I put the a module Taxonomy Path Breadcrumb together, which enables users to configure per vocabulary whether to use taxonomy breadcrumb builder or path based breadcrumb builder.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
FileSize
132 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.