Inconsistent count behaviour in /tags and dropdown filter


(Leo McArdle) #1

Continuing the discussion from Private tags incorrectly shown in tags drop-down:

The tags dropdown filter and the tags page have surprisingly different behaviours, I’ll use https://community.namati.org/ as my example to demonstrate these behaviours (since @tobiaseigen is finding this discrepancy particularly troublesome).

Here we see the dropdown and /tags page side by side. If we look close we can see that there are tags which appear in /tags but not the dropdown (such as africa), and the opposite (like with birthday).

Tags appearing in /tags but not the dropdown is explainable and expected with a max_tags_in_filter_list which is less than the number of tags which exist, but the reverse is unexpected and seems to me to be a bug.

birthday is a tag which belongs to quite a number of topics, but none of them are accessible to a non-logged in user. The /tags page is, quite sensibly, using a count of the number of posts each tag belongs to which are accessible to the current user, and hiding tags which belong to no accessible posts. The dropdown is exhibiting quite different behaviour by using a count of the total number of topics, accessible to the user or not, in determining whether to show the tag.

Instead, I believe the dropdown should have the same behaviour as the /tags page, determining whether tags should be shown or not based on the number of accessible topics to the current user.


(Jeff Atwood) #2

Might be an anon caching issue, though.


(Neil Lalonde) #3

I’m guessing your settings look like this:

Increase the max tags in filter list value to be greater than the number of tags you have if you want to use that dropdown and have all the tags in there. Or uncheck “tags sort alphabetically”.


(Leo McArdle) #4

That won’t solve tags appearing in that dropdown which don’t appear on /tags. This ain’t no support request, this is a bug about inconsistent behaviour.


(Neil Lalonde) #5

Ok I had a look on your site and it looked like those were the settings. I’ll have another look shortly.


(Neil Lalonde) #6

This behaviour was caused by that dropdown not being scoped to current user and category. It was always a site-wide list of most popular tags. Notice that changing the category filter has no effect on the tags in the tag filter dropdown. It hasn’t been updated based on the new features added to tags recently (category-specific tags, etc.). So I updated it so it’s more dynamic.

The tags in the list are now based on topics that you can see within the current scope (all categories, or filtered to a category).