Problem/Motivation

The node edit route is created in \Drupal\node\Entity\NodeRouteProvider and has neither a '_title' nor a '_title_callback'.

That was fine until this commit: https://cgit.drupalcode.org/easy_breadcrumb/commit/?id=4d2df56

Before this commit

$title = $this->titleResolver->getTitle($route_request, $route_match->getRouteObject());

resulted in $title being NULL, and therefore !isset($title) being TRUE, and therefore a fallback title was created via

$title = str_replace(array('-', '_'), ' ', Unicode::ucfirst(end($path_elements)));

But after this commit

$title = $this->getTitleString($route_request, $route_match, $replacedTitles);

results in $title being FALSE, and therefore !isset($title) being FALSE, and therefore a no fallback title is created anymore.

Proposed resolution

The function getTitleString should return NULL instead of FALSE.

Remaining tasks

Review.

User interface changes

Breadcrumb for node edit available again.

API changes

None.

Data model changes

None.

Comments

Maouna created an issue. See original summary.

Maouna’s picture

Assigned: Maouna » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.16 KB
greg boggs’s picture

Wow. Nice catch! Thank you.

daggerhart’s picture

Status: Needs review » Reviewed & tested by the community

Great catch and solution. Patch is simple, applies cleanly, and resolves the issue. Thanks!

loopduplicate’s picture

StatusFileSize
new1.3 KB
new715 bytes

Looks great! I found one code comment that needed updating. Committing soon :)

  • loopduplicate committed 00ccf02 on 8.x-1.x
    git commit -m 'Issue #2971408 by Maouna, Greg Boggs, daggerhart,...
loopduplicate’s picture

Status: Reviewed & tested by the community » Fixed

Thanks :)

Status: Fixed » Closed (fixed)

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