1
0
mirror of synced 2026-05-22 15:03:15 +00:00
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
2026-01-15 11:23:49 +01:00
2024-10-14 10:04:53 +02:00
2024-03-27 18:32:45 +00:00
2024-10-17 11:11:14 +02:00
2024-10-17 11:11:14 +02:00
2024-03-27 18:32:45 +00:00
2024-06-09 10:17:29 +01:00
2024-10-17 11:11:14 +02:00
2022-04-05 11:28:13 -06:00
2025-10-09 13:43:22 +01:00
2025-10-09 13:43:22 +01:00
2022-04-27 10:56:42 -06:00
2025-03-17 10:44:00 +00:00
2024-06-11 13:36:41 +02:00

discourse-gated-topics-in-category

This theme component allows site admins to show a login prompt that covers the topic contents in specific categories as a way to encourage readers to sign up and log in.

image
📖 Learn More https://meta.discourse.org/t/gated-topics-in-category/225454
Install Guide How to install a theme or theme component
🧠 New to Discourse Themes? Beginners guide to using Discourse Themes
S
Description
This theme component allows site admins to show a login prompt that covers the topic contents in specific categories as a way to encourage readers to sign up and log in
Readme MIT 855 KiB
Languages
JavaScript 64.8%
Ruby 27.3%
SCSS 7.9%