Problem/Motivation
The settings form allows disabling "Strip query string before normalization". PathNormalizer also supports keeping query strings when this setting is off. But Smart404Subscriber passes only $request->getPathInfo() to the logger, and getPathInfo() never includes the query string. By the time PathNormalizer runs, the query string has already been discarded.
Steps to reproduce
- Install Smart 404 in a fresh Drupal 11.x.
- Go to
`/admin/config/system/smart-404`. - Uncheck "Strip query string before normalization".
- Uncheck "Ignore 404s from administrators" so the issue can be reproduced while logged in as an administrator, then save.
- While logged in as the administrator, visit two missing URLs with the same path but different query strings, for example:
`/missing-product?id=1`
`/missing-product?id=2` - Go to `/admin/reports/smart-404`.
Expected
Because query-string stripping is disabled, the two requests are logged as separate entries:
`/missing-product?id=1`
`/missing-product?id=2`
Actual
Smart 404 logs a single `/missing-product` row with 2 hits. The query strings are discarded before the path reaches PathNormalizer, so the setting has no effect.
Issue fork smart_404-3606698
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:
- 3606698-strip-query-string
changes, plain diff MR !2
- 1.0.x
changes, plain diff MR !3
Comments
Comment #8
mookum commentedComment #10
dkmishra commentedHi! Thanks for reviewing and committing the fix.
I noticed I wasn't credited for this issue. Since I reported the issue and also created the merge request that was committed, would you mind adding issue credit for my contribution if you think it's appropriate?
Thank you!