Problem/Motivation

That service does not check if there is a route object before accessing it. This is very likely caused by #3504386: Use a placeholder for the navigation toolbar but there might be other cases where this could have happened as well.

Steps to reproduce

Visit /does-not-exist.

Note that the error is only appended to the regular response and not immediately visible because it's a big pipe lazy builder.

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3560106

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

berdir created an issue. See original summary.

berdir’s picture

Status: Active » Needs review

It looks like this is in fact not caused by #3504386: Use a placeholder for the navigation toolbar, at least I an still reproduce the error with that enabled, didn't investigate further.

Started a JS test to expose this issue, not sure if it fail like that on CI, it's also very bare bones. This could of course be simulated with a unit test, but I think there's value in a real-world JS test with big_pipe enabled as we don't seem to have explicit coverage of this at the moment and since we now explicitly use a lazy builder for this, that seems like useful test coverage to have. Possibly just copy over the test coverage from the non-JS test, I didn't add that yet.

plopesc’s picture

Interesting. Found an inconsistency in core behavior that's different for logged in and anonymous users.

When in a 404 page, for anonymous users \Drupal::routeMatch()->getRouteObject() return the object for system.404 route. Hovwever, for user 1, it returns NULL.

It might be the root cause of this bug.

I'm not sure whether this is the expected behavior or a regression introduced somewhere else that might need its own issue, or it's being analyzed somewhere else.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Bug Smash Initiative, +Needs Review Queue Initiative
StatusFileSize
new27.24 KB

There was already a comment by @plopesc but I did confirm the bug

bug

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.

larowlan’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#3565886: Navigation module throws an error on missing URL

Closed as dupe of #3565886: Navigation module throws an error on missing URL and transferred credit over there

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.