0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/spec
Régis Hanol aec18e9f70
FIX: Consistently exclude synonyms and hidden tags from tag lists (#42364)
Every endpoint that lists tags for browsing hand-rolled its own filter
chain, and they had drifted apart.

The tags page filtered synonyms out when tags were listed flat but not
when they were listed by group, so a synonym of a tag belonging to no
tag group was shown next to its target — a duplicate entry whose page
only redirects back to the tag it duplicates. Synonyms of grouped tags
were hidden by accident rather than by design: creating a synonym copies
the target's tag group memberships onto it, which happens to satisfy the
"belongs to no tag group" condition the ungrouped list is built from.
Non-admins were shielded by a second accident, since a synonym normally
ends up with a zero topic count — so any synonym that kept its topics,
whether from an import, a plugin, or assigning `target_tag_id` directly,
was listed to everyone.

Tag visibility has two independent mechanisms: tag group permissions,
and the categories a tag is attached to. Only the second one can apply
to a tag that belongs to no tag group, and neither the grouped tags page
nor the tag group search endpoint applied it, so the names of tags
restricted to a category the viewer cannot read were listed to them.
`TagGroup.visible` gates which groups are returned, never the tags
inside them.

The navigation menu tag picker filtered out neither synonyms nor tags
only used in personal messages, and gated on staff where the tags page
gates on admin, so moderators were served the entire tag table. A
synonym picked there was saved as a sidebar link and rendered from then
on. Top tags and tag search had the same gap.

Paths that resolve a tag by name keep matching synonyms on purpose: the
composer offers them so that typing a retired name finds the tag that
replaced it, and hashtags in posts cooked before a rename have to keep
working. Serializers that echo configuration back are left alone,
because filtering a value the client posts straight back would silently
delete it.
2026-08-05 20:29:35 +02:00
..
db FIX: Prevent backslash accumulation in upload markdown labels (#39461) 2026-06-03 18:10:38 +02:00
fabricators FIX: can_create_discourse_post_event? not checking user groups correctly (#42284) 2026-08-04 16:09:50 +10:00
fixtures DEV: Add image-processing regression coverage (#42117) 2026-07-30 15:28:07 +08:00
generator
helpers UX: Hide signup when the site is in read only or staff only mode (#42101) 2026-07-28 20:05:04 +02:00
import_export
initializers FIX: Do not notify new sites or plugins enabled of old upcoming changes (#42045) 2026-07-30 09:51:08 +10:00
integration FIX: store method in route matcher (#41512) 2026-07-07 11:49:56 -04:00
integrity DEV: hide and disable upcoming changes for disabled plugins (#41657) 2026-07-16 14:35:20 +04:00
jobs FEATURE: Reclassify likely crawlers in site traffic reporting (#42199) 2026-08-04 10:08:53 +08:00
lib FIX: Consistently exclude synonyms and hidden tags from tag lists (#42364) 2026-08-05 20:29:35 +02:00
mailers DEV: remove simple email subject upcoming change metadata (#41807) 2026-07-20 14:43:00 +04:00
migrations FIX: Ensure each flag gets a unique name_key (#40899) 2026-06-24 16:37:59 +02:00
models FIX: Consistently exclude synonyms and hidden tags from tag lists (#42364) 2026-08-05 20:29:35 +02:00
multisite
queries/reports FEATURE: Change default upcoming change promotion status to Beta (#41275) 2026-07-06 09:13:37 +10:00
requests FIX: Consistently exclude synonyms and hidden tags from tag lists (#42364) 2026-08-05 20:29:35 +02:00
script DEV: Fix UC status report when reverted files encountered (#41821) 2026-07-20 16:37:35 +10:00
serializers SECURITY: Enforce first-post visibility for topic bookmarks (#42321) 2026-08-05 12:52:40 -05:00
services SECURITY: Enforce first-post visibility for topic bookmarks (#42321) 2026-08-05 12:52:40 -05:00
support DEV: Add image-processing regression coverage (#42117) 2026-07-30 15:28:07 +08:00
system FIX: Don't rewrite the composer value when opening the rich editor (#42365) 2026-08-05 15:27:05 -03:00
tasks DEV: Prefer RSpec primitives for test setup (#42122) 2026-07-30 11:17:22 +08:00
views
rails_helper.rb DEV: Prefer RSpec primitives for test setup (#42122) 2026-07-30 11:17:22 +08:00
regenerate_swagger_docs
swagger_helper.rb