Skip to content

fix(routing): guard storefront alias resolution during error handling - #36

Merged
Seiger merged 2 commits into
Seiger:1.xfrom
MiddleSokilAI:sokil/not-found-request-guard
Nov 2, 2026
Merged

Seiger merged 2 commits into
Seiger:1.xfrom
MiddleSokilAI:sokil/not-found-request-guard

Conversation

@MiddleSokilAI

@MiddleSokilAI MiddleSokilAI commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Legacy Manager/API entrypoints can dispatch OnPageNotFound before the HTTP request service is bound, causing Target class [request] does not exist. Storefront alias resolution can also run again after an internal forward, and a stale product placeholder can replace the selected error document.

The routing guards skip Manager/API and requestless alias resolution, avoid re-entering alias lookup after internal forwards, and preserve internally selected error/unauthorized documents. Empty paths no longer access an undefined array offset. Valid product and language-prefixed aliases keep working.

The full regression suite also exposed two existing failures: quick checkout retained a validated piece quantity as a string, and the piece cart/order JSON fixture omitted physical fields already emitted by the base branch. Piece quantities now become integers after validation and the maximum check; validation plugins still receive raw input. The JSON fixture now includes the existing weight and dimension fields without changing totals or quantities.

Verification

  • PHP 8.4.20: runtime scripts and standalone regression scripts passed locally, including 41 checkout validation checks, 158 measured quantity checks and 35 webhook dispatch checks.
  • All 10 routing scenarios passed separately: missing request, Manager, API, product, language prefix, empty path, unknown path, internal forward, 404 and 401.
  • PHP lint and git diff --check passed.
  • GitHub CI passed on PHP 8.4 and 8.5: https://github.com/Seiger/sCommerce/actions/runs/41451729127 (head b4118fe).

Tests use isolated data and do not contact the site database, payment providers or TMS. No production deployment has been performed.

@Seiger
Seiger merged commit 71ab4cf into Seiger:1.x Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants