Custom breadcrumbs are removed

Created on 17 October 2022, over 2 years ago
Updated 6 March 2025, 27 days ago

Problem/Motivation

gin_preprocess_breadcrumb() removes ability to add custom breadcrumbs at least on entity edit pages.

Steps to reproduce

Create a BreadcrumbBuilder and add breadcrumbs to an entity edit route.
The added breadcrumbs are not displayed

Proposed resolution

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇩🇪Germany volkerk

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.

  • 🇪🇸Spain gejo

    I've ended up removing this function from a custom module.

    <?php
    /**
     * Implements hook_theme_registry_alter().
     *
     * This function prevents the Gin theme from processing breadcrumbs by removing
     * its preprocess callback from the theme registry. As a result, the theme will
     * no longer invoke gin_preprocess_breadcrumb().
     */
    function MYMODULE_theme_registry_alter(&$theme_registry) {
      // Check if the 'breadcrumb' hook has any registered preprocess functions.
      if (isset($theme_registry['breadcrumb']['preprocess functions'])) {
        foreach ($theme_registry['breadcrumb']['preprocess functions'] as $key => $function) {
          // Identify the 'gin_preprocess_breadcrumb' function.
          if ($function === 'gin_preprocess_breadcrumb') {
            // Remove it so it won't be executed for breadcrumb rendering.
            unset($theme_registry['breadcrumb']['preprocess functions'][$key]);
          }
        }
      }
    }
    ?>
  • 🇨🇭Switzerland saschaeggi Zurich

    I'm closing this one as it hasn't been worked on since 2022.

Production build 0.71.5 2024