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.
Issue fork custom_breadcrumbs-3198500
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
Comment #3
asherry commentedWe'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!
Comment #6
lamp5