- Affected version
- 2.2.1
The alerts page call flow is;
But alerts pop-up is;
What I see as issues;
PHP:
$alertRepo->addContentToAlerts($alerts);
$alerts = $alerts->filterViewable();
$skipMarkRead = $this->filter('skip_mark_read', 'bool');
if ($page == 1 && $visitor->alerts_unviewed && !$skipMarkRead)
{
$alertRepo->autoMarkUserAlertsRead($alerts, $visitor);
$alertRepo->markUserAlertsViewed($visitor);
$this->markInaccessibleAlertsReadIfNeeded($alerts);
}
But alerts pop-up is;
PHP:
$alertRepo->addContentToAlerts($alerts);
$this->markInaccessibleAlertsReadIfNeeded($alerts);
$alerts = $alerts->filterViewable();
$alertRepo->autoMarkUserAlertsRead($alerts, $visitor);
if ($visitor->alerts_unviewed)
{
$alertRepo->markUserAlertsViewed($visitor);
}
What I see as issues;
markInaccessibleAlertsReadIfNeeded
is called after$alerts->filterViewable();
andautoMarkUserAlertsRead
.
This makesmarkInaccessibleAlertsReadIfNeeded
abort early as all alerts are viewable and$hasInaccessibleUnread
will never be set- Mark-as-read logic is gated behind alerts_unviewed checks (ie has unviewed, page count, etc)