Drupal-Version 10.2.2
PHP Version 8.1.26
I have the next code to generate breadcrumbs and render them as a custom variable
public function getBreadcrumbs(EntityInterface $entity) {
$routeName = $entity->toUrl()->getRouteName();
$routeParameters = $entity->toUrl()->getRouteParameters();
$route = $this->routeProvider->getRouteByName($routeName);
$routeMatch = new RouteMatch($routeName, $route, $routeParameters, $routeParameters);
return $this->easyBreadcrumb->build($routeMatch)->toRenderable();
}
It works for regular websites, but if the website has a subfolder logic of setRouteContextFromRouteMatch method does not work
so I think that we need to add a subfolder check and remove it from the URL, to make breadcrumbs work
Issue fork easy_breadcrumb-3437332
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
rollins commentedAttached MR with the fix for this bug
Comment #4
oleksandr.roshchuk commentedConfirm that the issue is fixed, thanks.
Comment #7
greg boggsThanks!