Editing topics with tag groups from parents allows incorrect tagging

AI-generated summary

A bug was reported where editing topics with tag groups from parent categories allows incorrect tagging. sterretje demonstrated that while composing a new topic works as expected, editing it later—whether via the composer or the pencil icon—results in invalid tag combinations being saved (e.g., retaining both parent tags after changing make or removing model). The issue also allows selecting tags from multiple model groups during edits, which should be restricted. The bug was resolved in pull request #21490 saquetim, and sterretje confirmed the fix works as intended.

Hello

I’m following Set up structured tagging with tag groups and category tag restrictions

1) Composing a new topic and submitting works as expected
image

2) After changing the make (and keeping the model as is) in an edit of the topic and submitting both parent tags are present. A submit of this should not have gone through.
image

3) After removing the model in an edit of the topic and submitting only both parent tags are present. Again, a submit of this should not have gone through.
image

It does not matter if I edit the topic using the composer or edit the topic using the black pencil next to the topic title; in both cases the incorrect behaviour happens.

Using the composer to add tags, I can now select from both model groups; as expected, I can only select one. This might also apply to editing the topic using the black pencil.

This issue should be resolved in

https://github.com/discourse/discourse/pull/21490

4 Likes

This fix was tested with expected results :+1:

1 Like