EasyBreadcrumbBuilder: If invalid path, try to fetch the content entity title or name by redirect source uri

Created on 15 July 2020, over 4 years ago
Updated 27 June 2024, 9 months ago

Hi,

around line 467 in

\Drupal\easy_breadcrumb\EasyBreadcrumbBuilder::build()

the breadcrumbs are build by the uri path elements.

elseif ($this->config->get(EasyBreadcrumbConstants::INCLUDE_INVALID_PATHS) && empty($exclude[implode('/', $path_elements)])) {

This is mostly leading to broken breadcrumb titles. E.g. german umlauts (Ä, Ö, Ü, ß) cannot be retrieved by that. Also combined nouns (e.g. North America).

I've figured out to get the correct titles by the redirect urls. Most Drupal projects are using the redirect module. If it's installed, my service will retrieve the titles from the redirects. Since the redirects are pointing to the original content entity. The patch will correct the breadcrumb titles for many users of the easy breadcrumb module I think.

See the attached patch. Please be so kind and review the path and apply it to the easy breadcrumb project.

Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

Live updates comments and jobs are added and updated live.
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