Tag Counts Missing on Tags Page

I’ve recently observed that the tag counts (e.g., “Java X 10”) are no longer visible on our /tags page. Instead, we only see a list of tags without their respective counts.

Any insights on what might be causing this sudden disappearance of counts would be greatly appreciated. Thank you!

My guess would be you have theme that removes it. I don’t see the problem on Meta or any of the sites I regularly use.

If you have a chunk of private categories it could be the include secure categories in tag counts admin setting?

1 Like

Hi Jon, Thank you for your reply. Unfortunately, I haven’t introduced any new themes.

Hi JammyDodger! I do have a chunk of private categories. I will have a look at that setting. Ty!

1 Like

The ‘include secure categories in tag counts` admin setting was disabled. I enabled it, but unfortunately no luck in showing the tag counts.
Strange.

I tried to debug the issue. Here is what I figured out.

I found the site on another topic and checked it without plugins/themes, but the issue still happens.

What is odd is the count in the API.

Looking at the source code:

discourse/app/assets/javascripts/discourse/app/templates/components/tag-list.hbs at v3.0.6 · discourse/discourse · GitHub
image

I tried to debug to see, and the count is well passed. It is; no problem here.

However, we can see the pmCount is undefined. This is likely the issue because the totalCount has a NaN (Not A Number) value now, which is why the condition in the template is ignoring it.

image

Looking at the GIT history, this function has been fixed in this PR where you can see pmCount is being checked before adding the two numbers.
SECURITY: Hide PM count for tags by default (#20061) · discourse/discourse@f31f0b7 · GitHub
image

This fix is available since 3.1.0.
Searching your Discourse version gives me you’re using an old stable version 3.0.6

image

Short version:

You’re using Discourse 3.0.6, and a fix landed in 3.1.0, which fixed indirectly this issue. :thinking:
You can probably fix your issue by updating to the latest stable version, which is 3.2.0 or, at the very least, 3.1.0.

2 Likes

Fantastic! Many thanks, Arkshine! I appreciate your time, and superb debugging skills are greatly valued in pinpointing the root cause.

I will follow up with our server admin regarding the upgrade.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.