Refactor PathBasedBreadcrumbBuilder to not use AccessAwareRouter for building links

Created on 18 February 2015, about 10 years ago
Updated 15 April 2025, 27 days ago

Coming from #2286971-83: Remove dependency of current_user on request and authentication manager

The PathBasedBreadcrumbBuilder is using the AccessAwareRouter to find matching routes as it is building the breadcrumb off of the current path. Unfortunately, the $request object passed in is incomplete (no route parameters) resulting in the exceptions as well as the auth failures.

Another undesirable side effect of this is that authentication is re-run multiple times as the breadcrumb links are being built.
A way to fix this would be to changing the PathBasedBreadcrumbBuilder to use a route matcher (e.g. NestedMatcher) instead of a router to build its links.

Each time a breadcrumb is built, all route enhancers (including ParamConverters and EntityRouteEnhancers) are called for each link in the breadcrumb. This is not good for performance.

Using a request matcher directly would short circuit the calls to the route enhancers.

📌 Task
Status

Active

Version

11.0 🔥

Component

request processing system

Created by

🇳🇬Nigeria almaudoh

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024