Currently, the Easy Breadcrumb module generates JSON-LD structured data by calling its own internal builder:
$breadcrumb = $this->easyBreadcrumbBuilder->build($this->routeMatch);

While this works for simple cases, it bypasses the standard Drupal core breadcrumb management system. If other modules or custom themes are using hook_breadcrumb_alter or custom Breadcrumb Builders with a higher priority, the JSON-LD generated by Easy Breadcrumb may get out of sync with the actual breadcrumbs displayed on the page.

Proposed resolution
Modify the service responsible for JSON-LD injection to use the core Breadcrumb Manager service.
easy_breadcrumb/src/EasyBreadcrumbStructuredDataJsonLd.php:88

Current logic:
$breadcrumb = $this->easyBreadcrumbBuilder->build($this->routeMatch);

Proposed logic:
$breadcrumb = \Drupal::service('breadcrumb')->build($this->routeMatch);

Comments

sanyasd created an issue.

greg boggs’s picture

looks like a worth while change, but we'll need to make sure not to call \Drupal directly because it's a coding standard and pass it in via the service.

greg boggs’s picture

We'll also need to confirm we still get correct breadcrumbs with EB settings applied.