Issue #3510983 by sriram: Ignore anchor fragment menu links when resolving the...
Reproduced this from the report. I created a page with a menu item pointing to it, plus a few sub-links that jump to anchor sections on that same page (e.g. /page, /page#section-a, /page#section-b) and turned on "use menu title as fallback". The breadcrumb then showed the anchor link's title instead of the page's title.
The cause: a URL fragment (the #section-a part) isn't part of the route, so all those anchor links and the page's own link resolve to the same route. loadLinksByRoute() returns all of them, and the builder was just taking the first one — which could be an anchor sub-link rather than the page itself.
The fix filters out menu links that have a fragment when more than one link matches the route, so the page's own link is used for the title. If every matching link has a fragment, they're kept as-is so nothing else changes.
Added a Kernel test — it fails on the current code and passes with the fix.