Better viewonline route checking - #194
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #194 +/- ##
============================================
+ Coverage 60.00% 60.38% +0.38%
- Complexity 222 226 +4
============================================
Files 18 18
Lines 815 828 +13
============================================
+ Hits 489 500 +11
- Misses 326 328 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request improves how the Pages extension detects “who is viewing a Page” in the Who Is Online view by matching against Symfony route paths rather than relying on a specific front-controller name (e.g., app.php) or exact session_page string equality.
Changes:
- Inject the phpBB router into the Pages event listener and use it to map route paths to Pages dynamic route IDs.
- Update
viewonline_page()to parsesession_page, strip the front controller, and resolve the page by route path (including query-string tolerance). - Extend and adjust unit tests to cover alternative front-controller names and query strings; update listener construction in tests and service wiring.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
event/listener.php |
Reworks viewonline location detection using router route paths and cached path→page-id mapping. |
config/services.yml |
Adds the router service as a constructor argument for the Pages listener. |
tests/event/event_listener_base.php |
Provides a mocked router + route collection to support the new listener dependency in tests. |
tests/event/event_listener_viewonline_test.php |
Adds test cases for non-app.php front controllers and query strings in session_page. |
tests/event/show_page_links_test.php |
Updates listener instantiation to supply the newly required router dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
No description provided.