Reproducible with at least:

  • Drupal 8.2.6
  • Drupal 8.3.0-beta1 via

Not reproducible with:

  • Drupal 7.54 via

Steps to reproduce:

  1. Structure -> Content types -> Add content type, or /admin/structure/types/add
  2. Enter "Rock & Roll" as name (note: machine name is rock_roll) and save
  3. Check the breadcrumbs at the manage fields page: /admin/structure/types/manage/rock_roll/fields

Actual result:

The breadcrumbs are shown as:

Home » Administration » Structure » Content types » Rock roll

The real human-readable name isn't being used, instead the machine name is being converted into the wrong human-readable name.

This could be very misleading: if the original name was "My content type" (machine name: my_content_type), and it is renamed to "My content type (legacy, do not use)", it will still display "My content type", possibly causing confusion with a new "My content type".

Expected result:

The breadcrumbs are shown as:

Home » Administration » Structure » Content types » Rock & Roll

Drupal 7.54 does not have this problem, it shows:

Home » Administration » Structure » Content types » Rock & Roll


Looks like the problem is somewhere in here, getTitle isn't returning a value and the fallback creates the misleading name:


          $title = $this->titleResolver->getTitle($route_request, $route_match->getRouteObject());
          if (!isset($title)) {
            // Fallback to using the raw path component as the title if the
            // route is missing a _title or _title_callback attribute.
            $title = str_replace(array('-', '_'), ' ', Unicode::ucfirst(end($path_elements)));

Proposed resolution

Implement a title callback to the Node type edit form, similar to the implementation for Taxonomy vocabularies:

_title_callback: '\Drupal\Core\Entity\Controller\EntityContoller::title'

Members fund testing for the Drupal project. Drupal Association Learn more


hugovk created an issue. See original summary.

hugovk’s picture

Issue summary: View changes
krknth’s picture

Assigned: Unassigned » krknth

I can confirm this issue exists with Drupal 8.3. And it looks fine with latest D7 version.

krknth’s picture

Assigned: krknth » Unassigned

The issue is there is no title callback for those routes in Drupal 8. But Drupal 7 implementing title callback in hook_menu.

File node.module, node_menu()

$items['admin/structure/types/manage/%node_type'] = array(
    'title' => 'Edit content type',
    'title callback' => 'node_type_page_title',
    'title arguments' => array(4),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('node_type_form', 4),
    'access arguments' => array('administer content types'),
    'file' => '',
chiranjeeb2410’s picture

Assigned: Unassigned » chiranjeeb2410


What should be done regarding this issue as of now ?

hugovk’s picture

Ideally I'd like to see the Drupal 7 implementation ported to Drupal 8, or a new one implemented if that makes more sense. But I'm not familiar enough with it to create a patch.

Would someone else be able to look into this, or give some pointers?

chiranjeeb2410’s picture

I think '_title_callback' => '\Drupal\Core\Entity\Controller\EntityController::title' should do the trick.

nikunjkotecha’s picture

Status: Active » Needs review
1.07 KB

I confirm the fix shared in #7 works. Attached patch to fix in nodes as well as custom block types. It seems working fine in Taxonomy terms.

chiranjeeb2410’s picture

Uploading patch with required changes. Should work.

hugovk’s picture

Status: Needs review » Needs work

Thank you chiranjeeb2410 and nikunjkotecha!

I've partially tested patches #8 and #9 and that part I've tested is working:

I manually applied the patch changes to Drupal 8.2.6 and ran drush cr, then edited a content type. The breadcrumb shows the correct human-readable title.

However, I haven't tested the fix for custom block types. How can this be tested?

Note there's a probable typo for custom block types in patch #9:

+ _title_callback: '\Drupal\Core\Entity\Controller\EntityContoller::title'

Patch #8 is identical except for:

+ _title_callback: '\Drupal\Core\Entity\Controller\EntityController::title'

Pavan B S’s picture

Status: Needs work » Needs review
1.07 KB
613 bytes

Made changes as per the suggestion in comment #10.Applying the patch please review.

hugovk’s picture

The patch in #11 is the same as the patch in #8 and does not have the typo.

But how can it be tested?

NikitaJain’s picture

Verified the patch for nodes, custom block types and taxonomy terms. Its working fine for all.
Steps to check for custom blocks:
1. Navigate to /admin/structure/block/block-content/types
2. Click on 'Add custom block type'
3. Enter 'Rock & Roll' into the label field and save it.
4. You can able to see the new custom block type 'Rock & Roll'.
5. Click on 'Rock & Roll' on edit /admin/structure/block/block-content/manage/rock_roll
6. And then click on 'manage fields'.
7. You can able to see the breadcrumbs like this Home > Administration> Structure >Block layout >Custom block library > Rock & Roll

Screen-shots attached

xjm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -breadcrumbs, -breadcrumb, -Content type, -content types +Needs tests

Thanks @NikitaJain for the manual testing!

We should add an automated test for this as well as per the core testing gate.

hugovk’s picture

Hello! Thanks NikitaJain and xjm for reviewing!

nikunjkotecha, chiranjeeb2410 or Pavan B S, please could you create an automated test to go with your patch?

It'd be great to get this fix merged.

Thank you!

idebr’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
3.64 KB
4.71 KB

I have updated the existing BlockContentTypeTest and NodeTypeTest with a breadcrumb assertion based on the approach by tim.plunkett in the related issue #2513570-3: Changing name (label) of content type is not reflected in breadcrumb link text

The last submitted patch, 16: 2855636-16-tests-only.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 16: 2855636-16.patch, failed testing.

idebr’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: +Novice
3.96 KB
5.02 KB

Added the Novice tag since there is a clear problem, test case and proposed resolutation available

The last submitted patch, 19: 2855636-19-tests-only.patch, failed testing.

chiranjeeb2410’s picture

Status: Needs review » Reviewed & tested by the community


Patch applies cleanly. Thanks for the related tests. Changing to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 4d80891 to 8.4.x and 5d6ea2c to 8.3.x. Thanks!

I've credited @hugovk for raising the issue and providing feedback on patches. I've credited @krknth since their comments on the issue correctly identified what was missing from the route definitions. I've also credited @xjm for reviewing and noting the missing test coverage.

As this is a bug fix and a small change to the routing definitions with no API implications I've backported this bugfix to 8.3.x

  • alexpott committed 4d80891 on 8.4.x
    Issue #2855636 by idebr, Pavan B S, chiranjeeb2410, nikunjkotecha,...

  • alexpott committed 5d6ea2c on 8.3.x
    Issue #2855636 by idebr, Pavan B S, chiranjeeb2410, nikunjkotecha,...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.