Tag Groups are broken again

Environment

Discourse Version: latest-release +548

Plugin Commit: 4bfea70d

Steps to Reproduce

Add a tag field with a tag group, no tags display in the wizard

Example

Logs

n/a

1 Like

Thank you for the report. We’ll be looking into this ASAP.

1 Like

I am unable to reproduce on CW 4bfea70d and Discourse tests-passed c74c90ba so there must be more to this.

Does the attached wizard work on your instance, with a tag group called “New Tag Group” ?

testforum-wizards-1685439717.json (211 Bytes)

No I’m afraid that doesn’t work:

I had this issues before:

But this time I don’t have the tag groups assigned in any categories.

Let me know if I need to give you admin access.

Intermediate result:

  • Compared settings wrt tags: no differences found
  • Looked into requests and results:

Works:

curl -H "Accept: application/json" 'https://testbeta.discoursehosting.net/tags/filter/search?q=&limit=1000&filterForInput%5Bgroups%5D=New%20Tag%20Group'

Works:

curl -H "Accept: application/json" 'https://community.naturephotographers.network/tags/filter/search?q=&limit=1000'

Does not work:

curl -H "Accept: application/json" 'https://community.naturephotographers.network/tags/filter/search?q=&limit=1000&filterForInput%5Bgroups%5D=New%20Tag%20Group'

Intermediate conclusion: something is preventing filterForInput[groups] from working correctly.

To be continued.

Inspection of the spec lead me to believe that this code should return only tags that are only in this tag group (“returns tags only in the tag group”)

So I added another, new, tag to the tag group (unusedta(g)) and it appears.

At Nature Photographers Network

When trying to reproduce this on my instance, I found that discourse-tickets was post-filtering the filter_allowed_tags result :scream: I did not dive into this because the client does not have that plugin installed.

I did grep through all known plugins to see which ones messed with the filter_allowed_tags function (multilingual, docs, tickets) but those are not installed on that instance either.

@angus @merefield any other ideas?

1 Like

I was not able to reproduce the issue.

what I did:

  • local test instance
  • created “New Tag Group” Tag Group, which starts off with one tag “feedback” (you have to pre-populate at least one Tag)
  • ran this test wizard
  • Drop down includes “feedback”.

What am I missing?

Do we have a list of all plugins that are running, are they all open sourced?

Good question.

I was able to reproduce the issue by including one tag in one of the tickets tag groups, but as soon as I removed it from there the issue disappeared. And the client is not running that plugin.

That, and the original wizard that the client reported this issue on, does use a tag group that has a number of tags that are not in other groups. And they still do not appear.

Yes, but again: I already grepped through all 413 plugins I have on file here, and none of the plugins that use the filter seem to be installed. The only plugin that I could not check was the private discourse-custom-email-digest-enabled one.

discourse-adplugin
discourse-ai
discourse-automation
discourse-calendar
discourse-canned-replies
discourse-category-lockdown
discourse-custom-email-digest-enabled
discourse-custom-wizard
discourse-data-explorer
discourse-follow
discourse-fontawesome-pro
discourse-gamification
discourse-locations
discourse-nationalflags
discourse-onesignal
discourse-post-badges-plugin
discourse-reactions
discourse-spoiler-alert
discourse-subscription-client
discourse-templates
discourse-user-notes
discourse-whos-online
1 Like

Then I think that should be checked @davidkingham

can you grep this plugin for filter_allowed_tags?

Thanks for digging into this guys, I did some experiments on my sandbox which is a clone of NPN. I disabled all plugins except CW and the issue still persists. I tried on another one of my sites and it works as expected. So it must be something to do with my configuration on NPN… Not sure where to go from here.

1 Like

Do you have any idea what you might have changed that caused to break it? That might give us a clue on where to look.

That’s the thing, I haven’t changed anything this month. It worked before upgrading Discourse, and then it stopped working after the upgrade…

1 Like

Would we be able to have shell access to the sandbox and the ability to tinker with it?

Of course, could you please remind me how to do that?

Can you please add this ssh key to your VPS and let me know the IP address in a PM?

Here’s how

I have found the cause.

TL;DR it is not caused by the plugin, the tag is excluded in Discourse core, and it is by design.

This wizard asks for a tag in the group Discussions and the first tag in that group is avian so I focused on that single tag and why it is not being returned.

discourse=# select * from tags where name='avian';
 id  | name  |         created_at         |         updated_at         | pm_topic_count | target_tag_id | description | public_topic_count | staff_topic_count 
-----+-------+----------------------------+----------------------------+----------------+---------------+-------------+--------------------+-------------------
 714 | avian | 2020-03-25 13:55:38.527856 | 2020-03-25 13:55:38.527856 |              0 |               |             |                 36 |                38
(1 row)

avian is in two tag groups,

discourse=# select * from tag_group_memberships where tag_id=714;
 id  | tag_id | tag_group_id |         created_at         |         updated_at         
-----+--------+--------------+----------------------------+----------------------------
 937 |    714 |           37 | 2020-03-26 13:46:36.425155 | 2020-03-26 13:46:36.425155
 938 |    714 |           41 | 2020-03-26 19:39:41.622834 | 2020-03-26 19:39:41.622834
(2 rows)
discourse=# select * from tag_groups where id in (37,41);
 id |    name     |         created_at         |         updated_at         | parent_tag_id | one_per_topic 
----+-------------+----------------------------+----------------------------+---------------+---------------
 37 | Categories  | 2019-04-13 19:36:46.669418 | 2019-04-13 19:36:46.669418 |               | t
 41 | Discussions | 2019-06-03 22:00:05.004574 | 2023-03-17 22:58:15.094194 |               | f

and those tag groups are in category tag groups

discourse=# select * from category_tag_groups where tag_group_id in (37,41);                                                                                                                                              
 id  | category_id | tag_group_id |         created_at         |         updated_at         
-----+-------------+--------------+----------------------------+----------------------------
 265 |          94 |           37 | 2020-08-27 14:15:57.666021 | 2020-08-27 14:15:57.666021
 269 |          94 |           41 | 2021-12-13 16:17:20.350314 | 2021-12-13 16:17:20.350314
 278 |         141 |           37 | 2022-08-11 21:10:07.229304 | 2022-08-11 21:10:07.229304
discourse=# select id, name from categories where id in (94,141);
 id  |         name         
-----+----------------------
  94 | Techniques & Methods
 141 | Upcoming NPN Events

So in that category we find them

Note the text that I have highlighted.

I.e. tags in the group “categories” and “discussions” will not be available in any other categories, so they are being excluded from the list when a generic tag selector is being shown.

1 Like

Thank you Richard, that was quite confusing. I really appreciate you looking into this, and I acknowledge that this had nothing to do with the plugin, so please do bill me for your time spent on this.

2 Likes

No problem David, I actually enjoy an occasional debug session.

1 Like

Thanks for picking this up Richard!

1 Like