Tag-chooser tags are not allowed

סיכום מבוסס בינה מלאכותית

The discussion addresses two reported issues with the tag-chooser form field type. gormus initially reported that the tag ID appeared in the post body instead of the name, and that selected tags were incorrectly rejected with an error stating they could not be used in the category.

Upon investigation, Moin suggested checking if the tag group was restricted to a different category. gormus confirmed that the Demo tag group was indeed enabled for the Demo category, preventing its use in General despite local settings. Moin clarified that this behavior is intended: tag groups are only available in categories that explicitly specify them. Consequently, gormus retracted the claim of a bug regarding the saving error.

However, the second issue regarding the display of tag IDs instead of names was confirmed as a regression. Moin noted this might be related to recent changes identifying tags by ID. sam verified that the system was incorrectly displaying the numeric ID (e.g., 46) instead of the tag name (e.g., #paintbrush). nat confirmed that this specific regression has been fixed in pull request #38018.

I observe two bugs related to tag-chooser type field:

  1. The tag ID is added to the post body, instead of the tag name (at least in preview)
  2. The selected tags are not allowed to be saved

The steps to produce:

  1. Create a form template with at least one tag-chooser field
  2. Enable the form template for a category
  3. Make sure the category’s tag settings have no restrictions
  4. Create a topic using the new form
  5. Observe the error message suggesting to remove the tags added via tag-chooser fields

An error occurred: The “paintbrush” tag cannot be used in the “General” category. Please remove it.

- type: tag-chooser
  id: demo
  tag_group: "Demo"
  attributes:
    none_label: "Select an option"
    label: "Demo"
    multiple: false
  validations:
    required: true

- type: composer
  id: post
  attributes:
    label: "Post"
    placeholder: "Enter post content"
  validations:
    required: true

- type: upload
  id: assets
  attributes:
    file_types: ".jpg, .png"
    allow_multiple: true
לייק 1

Can you create a topic with the tag in the category without a form template?

Are you sure that the tag group “Demo” and the tag “paintbrush” are not limited to another category? You shared the tag configuration of the “General” category, so we know that any tag is allowed there. But that doesn’t confirm that the tag or the tag group is not configured to be used exclusively in another category like “feedback”.
Did you check the information on the tags page?

My tag configuration for the “General” category looks like yours, but my “fixed” tag cannot be used there because it’s limited to the “issue” & “translation” categories.

2 לייקים

Good catch @Moin

I found that the Demo tag-group was already enabled for the Demo category.

After I removed the Demo tag-group, from the Demo category, I was able to use the form in General.

So, the Restrict these tag groups to the ‘…’ category setting doesn’t only control the tag group usage for the category, but every category trying to use that tag-group. Is that how it is intended?

לייק 1

I think so. Your screeshot shows a part of this note:

Tags and tag groups specified above will only be available in this category and other categories that also specify them. They won’t be available for use in other categories.

לייק 1

:facepalm:

Thank you, now it makes sense actually :))

edit: not a bug

לייק 1

I think your other issue is still relevant. Showing the name instead of the ID would be more helpful. This might be related to the recent changes to identify tags by ID instead of name.

4 לייקים

Confirmed, this is a regression

We will get it sorted, it should say #paintbrush there … not 46

4 לייקים

Yes that’s right.

This is fixed here:

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

4 לייקים

This topic was automatically closed after 2 days. New replies are no longer allowed.