Skip to content

[2.1] Log index, board and topic views again - #9778

Merged
live627 merged 1 commit into
SimpleMachines:release-2.1from
live627:fix-logging
Oct 24, 2026
Merged

live627 merged 1 commit into
SimpleMachines:release-2.1from
live627:fix-logging

Conversation

@live627

@live627 live627 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Moving the logging block below the maintenance/KickGuest chain in smf_main() meant requests with no action (BoardIndex, MessageIndex, Display) returned before writeLog() and trackStats() were reached. Members, guests and bots browsing the index, boards and topics were no longer shown in Who's Online, last-active was not updated for them, and hit stats were undercounted.

Run the logging block after the maintenance and KickGuest checks, so kicked guests are still not logged, but before the default-action branch. Both earlier branches return on every path, so the elseif (empty($_REQUEST['action'])) becomes a plain if.

$no_stat_actions and the integrate_pre_log_stats hook stay where they were.

Follow-up to #9215.
Reported at https://www.simplemachines.org/community/index.php?topic=595172.0

Moving the logging block below the maintenance/KickGuest chain in
smf_main() meant requests with no action (BoardIndex, MessageIndex,
Display) returned before writeLog() and trackStats() were reached.
Members, guests and bots browsing the index, boards and topics were no
longer shown in Who's Online, last-active was not updated for them, and
hit stats were undercounted.

Run the logging block after the maintenance and KickGuest checks, so
kicked guests are still not logged, but before the default-action
branch. Both earlier branches return on every path, so the
`elseif (empty($_REQUEST['action']))` becomes a plain `if`.

$no_stat_actions and the integrate_pre_log_stats hook stay where they
were.

Follow-up to SimpleMachines#9215.
Reported at https://www.simplemachines.org/community/index.php?topic=595172.0

Co-authored-by: Claude <noreply@anthropic.com>
@live627

live627 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

@albertlast could you update GuestPagesTest to assert that user activity is properly logged to log_online?

@albertlast

Copy link
Copy Markdown
Collaborator

you mean smf 3.0 right?

@live627

live627 commented Oct 18, 2026 via email

Copy link
Copy Markdown
Contributor Author

live627 pushed a commit that referenced this pull request Oct 19, 2026
The pages with no action in their URL are the ones 2.1 stopped logging in
#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>
@live627 live627 linked an issue Oct 19, 2026 that may be closed by this pull request
@live627

live627 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

@sbulen want to take a look at this?

@sbulen

sbulen commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Thanks for looking into this.

I hope to do some testing & review this week!

@sbulen

sbulen commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Code looks good. (Ooof...)

I have been testing, & guest activity looks good. Users on the forum report it solved their issue as well.

I have confirmed it plays nice with other recent log_online updates as well (#9125).

Thanks!

@live627
live627 merged commit b8fbfcf into SimpleMachines:release-2.1 Oct 24, 2026
11 checks passed
@live627
live627 deleted the fix-logging branch October 24, 2026 07:45
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.1.8]: Activity on pages without action no longer logged.

3 participants