Problem with Append current page title like the latest crumb

Created on 11 May 2023, about 1 year ago
Updated 12 May 2023, about 1 year ago

Problem/Motivation

I have a problem with โ€œAppend current page title like the latest crumbโ€. The last crumb has not been added by default to pages which are not configured by the Custom Breadcrumb module.

Steps to reproduce

For example, i have a node type "Basic page", i did not configure it by module.
Breadcrumbs should be: "Front page -> My page title", but i got only: "Front page".

It happens because in file /custom_breadcrumbs/src/BreadcrumbBuilder.php this part of code:

    if (!$this->matchPaths($route_match) && !$this->matchEntity($route_match)) {
      return FALSE;
    }

I did not configure this node type, and both functions return FALSE. As a result, the function return FALSE and does not add titles for nodes.

Proposed resolution

I have added one more check and titles are added to breadcrumbs properly:

    if (!$this->matchPaths($route_match) && !$this->matchEntity($route_match) && !$this->customBreadcrumbsSettings['current_page']) {
      return FALSE;
    }
๐Ÿ› Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

๐Ÿ‡ท๐Ÿ‡บRussia Psi-fact0r

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Psi-fact0r
  • Status changed to Closed: works as designed about 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ฑPoland lamp5 Rzeszow

    It is required to define any config for CB to make it works, instead of that, there is no way for other breadcrumbs to work both with CB. If you want to use page title like last crumb, i suggest you to use easy breadcrumb or yourtheeme_preprocesss_breadcrumb to set it up.

  • ๐Ÿ‡ท๐Ÿ‡บRussia Psi-fact0r

    Sorry, but i think it is bad decision.
    Maybe add some new option for this? Add a checkbox "Work with all breadcrumbs, not only configured". In my opinion, it's not good to use more and more modules for just breadcrumbs.
    As user, i want to download module and just it :)

Production build 0.69.0 2024