X Xon Well-known member Sep 12, 2017 #1 Affected version XF Beta 1 If a user has >999 unread alerts, the page title and bubble counter are zeroed out.
Kier XenForo developer Staff member Sep 12, 2017 #2 Hmm... well it's not a limit in the CSS or styling, as the inspector allows this ... so it must be something on the PHP side
Hmm... well it's not a limit in the CSS or styling, as the inspector allows this ... so it must be something on the PHP side
X Xon Well-known member Sep 12, 2017 #3 @Kier it appears to be a javascript/php localization issue. In updateVisitorCounts, visitor.alerts_unread has the literal string; "1,000" When calling XF.badgeCounterUpdate, there is the following code: Code: if (newCount > 0) { $badge.addClass('badgeContainer--highlighted'); } else { $badge.removeClass('badgeContainer--highlighted'); } "1,000" > 0 fails, so it removes the highlight class. Looking at where visitorCount is initialized in the page: Last edited: Sep 12, 2017
@Kier it appears to be a javascript/php localization issue. In updateVisitorCounts, visitor.alerts_unread has the literal string; "1,000" When calling XF.badgeCounterUpdate, there is the following code: Code: if (newCount > 0) { $badge.addClass('badgeContainer--highlighted'); } else { $badge.removeClass('badgeContainer--highlighted'); } "1,000" > 0 fails, so it removes the highlight class. Looking at where visitorCount is initialized in the page:
X Xon Well-known member Sep 12, 2017 #4 In the template; helper_js_global Code: visitorCounts: { conversations_unread: '{$xf.visitor.conversations_unread|number}', alerts_unread: '{$xf.visitor.alerts_unread|number}', total_unread: '{{ ($xf.visitor.conversations_unread + $xf.visitor.alerts_unread)|number }}', Piping to |number is going to hit localization issues on the JavaScript side likely having different formatting rules to the server.
In the template; helper_js_global Code: visitorCounts: { conversations_unread: '{$xf.visitor.conversations_unread|number}', alerts_unread: '{$xf.visitor.alerts_unread|number}', total_unread: '{{ ($xf.visitor.conversations_unread + $xf.visitor.alerts_unread)|number }}', Piping to |number is going to hit localization issues on the JavaScript side likely having different formatting rules to the server.
Kier XenForo developer Staff member Sep 12, 2017 #5 Just came to the same conclusion here, thanks for looking into it