1
0
mirror of synced 2026-05-22 15:03:15 +00:00
Files
discourse-gated-topics-in-c…/spec/system
Alan Guo Xiang Tan 4e4b632298 DEV: Add backward compatibility for tag object arrays (#60)
What is the problem?

Discourse core PR #36678 changes `topic.tags` from a string array
(e.g., `["support", "bug"]`) to an object array (e.g.,
`[{id: 12, name: "support", slug: "support"}]`). This breaks the
`TopicInGatedCategory#recalculate` method which checks if topic tags
include enabled tags using `this.enabledTags.includes(t)`.

What is the solution?

Update the gated tag checking logic to extract the tag name using
`typeof t === "string" ? t : t.name` before comparing against
`this.enabledTags`. This ensures backward compatibility with both
the old string format and the new object format.
2026-01-19 10:47:19 +08:00
..