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

  1. Install Smart 404 in a fresh Drupal 11.x.
  2. Go to `/admin/config/system/smart-404`.
  3. Uncheck "Strip query string before normalization".
  4. Uncheck "Ignore 404s from administrators" so the issue can be reproduced while logged in as an administrator, then save.
  5. 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`
  6. 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

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

dkmishra created an issue. See original summary.

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

  • mookum committed 85449f7a on 1.0.x authored by dkmishra
    Issue #3606698: Fixed Strip query string before normalization setting is...
mookum’s picture

Status: Active » Fixed

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.

dkmishra’s picture

Hi! 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!

Status: Fixed » Closed (fixed)

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