Skip to content

Use routing interfaces to identify action and area routes - #9919

Open
boredskull wants to merge 3 commits into
SimpleMachines:release-3.0from
boredskull:fix/9643-action-router-interfaces
Open

boredskull wants to merge 3 commits into
SimpleMachines:release-3.0from
boredskull:fix/9643-action-router-interfaces

Conversation

@boredskull

Copy link
Copy Markdown

Allow mod actions to use ActionRouter outside the SMF namespace and preserve area parsing for the admin and moderation handlers.#### Description

ActionRouter uses the handler’s namespace to decide whether it can build an action route and whether the second URL segment represents an area. This prevents mod authors from using the default router under their own namespaces.

This change uses the existing Routable interface for building action routes and adds AreaRoutable for handlers that accept an area before the optional sub-action. The admin and moderation handlers implement AreaRoutable to preserve their existing URL formats.

The routing test fixture now lives outside SMF\Actions. A new regression test checks that a plain routable action can build and parse a URL with a sub-action as its second segment.

Testing

  • All eight changed PHP files passed syntax checks.
  • PHP 8.5 round-trip checks passed for both third-party route formats and the core admin, moderate, and help actions.
  • The full PHPUnit suite was not run locally.

Issues References

Fixes #9643.

Allow mod actions to use ActionRouter outside the SMF namespace and
preserve area parsing for the admin and moderation handlers.

Signed-off-by: Bryan Deakin <358422552+boredskull@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[3.0] Hard-coded namespaces in ActionRouter should be replaced with interface checks

1 participant