Closed (fixed)
Project:
Easy Breadcrumb
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Apr 2024 at 09:01 UTC
Updated:
24 Apr 2024 at 15:19 UTC
Jump to comment: Most recent
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
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!