I'm currently using the drupal 8 version and I've noticed that this module will override all breadcrumbs; even if there are no custom breadcrumb entities defined in config.

The BreadcrumbBuilder class uses a very high priority (1003), which is fine, but the applies() function returns TRUE for all routes - except for admin paths when that setting is enabled. This will cause core's BreadcrumbManager to always use this module's breadcrumb builder, instead of allowing a fallback on lower priority breadcrumb builders.

In a project I'm currently working on, we would like to only use the custom_breadcrumbs module to override specific paths & node bundles. The rest of the pages could then use another breadcrumb builder class, with a lower priority set.

I've added 2 extra checks in the applies() function to make this work. I'll attach it as a pull request later.
Note: This is POC code; I've reused a lot of code from the existing applyContentEntityBreadcrumb() function. Ideally, it should be refactored - since it would introduce some duplicate code.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

robindh created an issue. See original summary.

asherry’s picture

We're running into the same issue. For all pages and nodes that don't have a handler in custom breadcrumbs they are showing up as just "Home / [title of page]". At the very least, Drupal's core system parses the path and gives you (at least in this case) a better breadcrumb, but I also believe this module should be able to work alongside something like 'easy breadcrumb' or 'menu breadcrumb'.

This patch worked for our use case, thank you!

lamp5 made their first commit to this issue’s fork.

  • lamp5 committed 41456f5 on 1.x authored by robindh
    Issue #3198500: Allow fallback on lower priority breadcrumb builders
    
lamp5’s picture

Version: 1.0.0-alpha2 » 1.x-dev
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.