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
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Screenshot 2025-12-02 at 11.05.17 AM.png | 27.24 KB | smustgrave |
Issue fork drupal-3560106
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:
- 3560106-accessing-a-page
changes, plain diff MR !13963
Comments
Comment #3
berdirIt 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.
Comment #4
plopescInteresting. 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.
Comment #5
smustgrave commentedThere was already a comment by @plopesc but I did confirm the bug
Comment #7
larowlanClosed as dupe of #3565886: Navigation module throws an error on missing URL and transferred credit over there