Repository navigation
[3.0] Adds a test that the board index, boards and topics are logged - #9781
Merged
live627 merged 1 commit intoOct 19, 2026
Merged
Conversation
The pages with no action in their URL are the ones 2.1 stopped logging in SimpleMachines#9778: Who's Online, last-active and the hit counter all missed them. 3.0 resolves them to BoardIndex, MessageIndex and Display before preflight() runs, so they log as any other action does. This pins that down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
@live627 asked for a test covering this case. In 2.1, #9778 found that the board index, boards and topics, the pages with no
?action=in their URL, had stopped being logged. Who's Online, last-active and the hit counter all missed them.3.0 does not have the bug, so this PR adds only the test.
Forum::findAction()resolves those requests toBoardIndex,MessageIndexandDisplay.Forum::preflight()then runs the logging before the action executes, and nothing in between returns early. None of the three overridescanBeLogged(), so they gettruefromActionTrait.tests/Integration/Http/DefaultViewLoggingTest.phpholds that in place:?board=1.0and?topic=1.0, each fetched as a guest with no cookies, must add a row tolog_onlineand exactly one hit tolog_activity.?action=helpadmin, whosecanBeLogged()is false, must change neither. This shows the assertions can tell a logged visit from one that was not.trackStatsandhitStatsare turned on only for the test. Afterwards they get their old values back, or are removed if they were not set before.Each request starts without cookies because
User::logOnline()skips a session it logged in the last 8 seconds. The client's ownlog_onlinerows are deleted first because a guest's row is keyed by IP and written withINSERT IGNORE, so a row left by an earlier test would otherwise be counted as this visit.What I ran, on MySQL and PostgreSQL:
preflight()(no logging when the request names no action): all three pages fail on both engines, and the control still passes.trackStats(['hits' => '+'])call removed: the hit assertion fails for all three pages.Issues References (Fixes|Related|Closes)
🤖 Generated with Claude Code