Problem/Motivation

In Umami, when visiting a 404 page, umami_preprocess_breadcrumb throws the following exception:
TypeError: Drupal\Core\Controller\TitleResolver::getTitle(): Argument #2 ($route) must be of type Symfony\Component\Routing\Route, null given, called in /var/www/html/core/profiles/demo_umami/themes/umami/umami.theme on line 113 in Drupal\Core\Controller\TitleResolver->getTitle() (line 51 of core/lib/Drupal/Core/Controller/TitleResolver.php).
It happens because $route_match->getRouteObject() returns NULL for these pages.

Code in umami_preprocess_breadcrumb() should check the existence of the route before trying to retrieve the page title.

Steps to reproduce

  • Install a fresh installations of Umami using 11.x
  • Login into the site
  • Access to a page like /foo
  • See the exception mentioned above in the page footer

Proposed resolution

Ensure that route object is available in umami_preprocess_breadcrumb and do not check for the title if it's not available.

page not found screenshot

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3560127

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

plopesc created an issue. See original summary.

aryan singh’s picture

Working...

aryan singh’s picture

Status: Active » Needs review
plopesc’s picture

Status: Needs review » Needs work

This MR should be in the scope of Umami. Please see recommendation in the IS to modify the logic in umami_preprocess_breadcrumb()

aryan singh’s picture

Status: Needs work » Needs review

Thanks @plopesc for your input.I have updated the code in "umami_preprocess_breadcrumb()".Please review and let me know if any further changes are needed.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

May be overkill but wonder if we can get a small test case or better extend an existing one.

mdranove made their first commit to this issue’s fork.

mdranove’s picture

Status: Needs work » Needs review

Added test

smustgrave’s picture

Status: Needs review » Needs work

Left comments on the MR.

mdranove’s picture

Status: Needs work » Needs review

Addressed comment

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests +Needs Review Queue Initiative

Feedback for this one appears to be addressed.

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Added a question to the MR.

mradcliffe’s picture

Issue tags: +Chicago2026

I performed Novice Triage on this issue. I am leaving the Novice tag on this issue because this would be a good opportunity to learn how to rebase based on core. The changes need to be moved to the Hooks implementation.

I could not find @longwave’s comment in the merge request so that may have gotten lost in the merge conflict.

The Drupal Contribution Mentoring team is triaging issues for DrupalCon Chicago 2026, and we are reserving this issue for Mentored Contribution during the event.

After Thursday 26th March 2026 + 1 DAY (13:00 UTC), this issue returns to being open to all. Thanks!

alexbaron77’s picture

I am currently solving the PR conflict at the contribution workshop of drupalcon chicago.

rklawson’s picture

I am helping (@rklawson) on the issue at DrupalCon Chicago 2026.

ksok101 made their first commit to this issue’s fork.

Please ignore, I'm just testing my first commit gitlab with @igorgoncalves at DrupalCon Chicago 2026.

dany.almeida.kairouz made their first commit to this issue’s fork.

dany.almeida.kairouz’s picture

Status: Needs work » Needs review
dcam’s picture

Assigned: Unassigned » dcam

Assigning to myself for the review.

dcam’s picture

Assigned: dcam » Unassigned
Status: Needs review » Needs work

Thank you very much to all of the new contributors in Chicago (or elsewhere) who worked on this issue!

I've reviewed the MR and left several comments on it for items that need to be changed. Please consider them. Some of them have suggestions included. If you think the suggestion is appropriate, then you can apply suggestions individually or as a batch on the merge request's page using the "Apply suggestion" dropdown above the suggestion.

If anyone needs clarification about something or has questions, then you can feel free to DM or tag me in the core-development channel of the Drupal Slack today where my username is @dcam.

alexbaron77’s picture

thanks dcam for the review and the help.

dany.almeida.kairouz’s picture

Status: Needs work » Needs review
fizcs3’s picture

Tested MR!13971 on Drupal 11.x-dev and confirming that the error no longer appears on the 404 page.

Code has already been reviewed by @dcam

fizcs3’s picture

Status: Needs review » Reviewed & tested by the community
mradcliffe’s picture

Thank you @fizccs3 for a review and test of the merge request, @dany.almeida.kairouz for mentoring, @alexbaron77 and @rklawson for making code changes and fixes for working on the issue, and thank you @dcam for working with them to provide review and resolving the comments.

fizcs3’s picture

working with @mradcliffe, who suggested I take a screenshot as well

alexbaron77’s picture

#reviewed

the initial fix has been fixed.

pipeline ok
unit tests ok

approved

godotislate’s picture

Status: Reviewed & tested by the community » Needs work

The test only job passes, when it should fail: https://git.drupalcode.org/issue/drupal-3560127/-/jobs/9113957

Can we make sure that there's a test demonstrates the problem without the fix?

dcam’s picture

There was a brief discussion in the core-maintainers Slack channel about this on March 26. @berdir noted that this issue was possibly fixed by #3349201: Big Pipe, logged-in users and 4xx pages and no longer exists. And no one actually confirmed that the issue still exists during their review, not even me. I was fighting with my local environment that day, which is why I never did a complete review after that initial code review in #22.

godotislate’s picture

OK, could someone confirm that it's still an issue, and close if not? In the meantime I've updated credit.

mdranove’s picture

Status: Needs work » Reviewed & tested by the community

I went ahead and added the single change from #3349201, the update to BigPipeStrategy.php to my fresh umami install using 11.3.6.

I could no longer repro the issue.

Im thinking we can close this.

dcam’s picture

Status: Reviewed & tested by the community » Closed (outdated)

Closing per #33.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.