Repository navigation
[2.1.8]: Activity on pages without action no longer logged. #9785
Description
Basic Information
Since updating to version 2.1.8 page views of boards and topics (Or any page without an action) are no longer logged. I have traced this back to the change made in e81ea6f.
By moving the logging to after the entire if/else block, it now also sits after the elseif (empty($_REQUEST['action'])) on line 286.
This elseif block however, contains early returns. Which in turn cause the activity logging to never be called for these pages.
Given that the initial 2 if/elseif blocks are valid exemptions for the logging, but the third one is not. And also given that anything that hits the initial 2 if/elseif blocks can never reach the code after due to the early returns present in these blocks. I suggest to change the final elseif into its own if, and move the activity logging to above this if.
// If guest access is off, a guest can only do one of the very few following actions.
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('coppa', 'login', 'login2', 'logintfa', 'reminder', 'activate', 'help', 'helpadmin', 'smstats', 'verificationcode', 'signup', 'signup2')))) {
return 'KickGuest';
}
$should_log = !is_filtered_request($no_stat_actions, 'action');
if ($should_log)
{
// Log this user as online.
writeLog();
// Track forum statistics and hits...?
if (!empty($modSettings['hitStats']))
trackStats(array('hits' => '+'));
}
unset($no_stat_actions);
if (empty($_REQUEST['action']))
{
// Action and board are both empty... BoardIndex! Unless someone else wants to do something different.
if (empty($board) && empty($topic))
{
if (!empty($modSettings['integrate_default_action']))
{
$defaultAction = explode(',', $modSettings['integrate_default_action']);
// Sorry, only one default action is needed.
$defaultAction = $defaultAction[0];
$call = call_helper($defaultAction, true);
if (!empty($call))
return $call;
}
// No default action huh? then go to our good old BoardIndex.
else
{
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';
}
}
// Topic is empty, and action is empty.... MessageIndex!
elseif (empty($topic))
{
require_once($sourcedir . '/MessageIndex.php');
return 'MessageIndex';
}
// Board is not empty... topic is not empty... action is empty.. Display!
else
{
require_once($sourcedir . '/Display.php');
return 'Display';
}
}Steps to reproduce
- Simply open any page that does not have an action in the URL
- Observe no change in activity on the "who is online" page, nor any change in the counters on board/topic activity views.
Expected result
No response
Actual result
No response
Version/Git revision
2.1.8
Database Engine
MySQL
Database Version
11.8.9
PHP Version
8.5
Logs
Additional Information
No response
Activity
live627 commentedon Oct 19, 2026
uh huh
how is this different?
Thidox commentedon Oct 19, 2026
Apologies it is not different. I wasn't able to find that PR earlier though...