Making a user's primary group non-visible (eventually) leads to a missing page

AI 生成的摘要

The discussion revolves around a feature issue in Discourse where making a user’s primary group non-visible leads to a broken link when clicking on the group name in posts. alehandrof explains that they set institutional groups as primary groups to display affiliation via the group title, but hid these groups to prevent visibility. However, clicking the group name results in a non-existent page. jomaxro notes this has been discussed before and requires custom code to fix, referencing past meta discussions. alehandrof agrees the solution works but considers it a bug. codinghorror humorously suggests avoiding such setups, while fhe defends the practice, arguing it’s reasonable to hide groups used for avatar flairs and that broken links are unexpected.

I’m guilty of trying something weird. But the system does allow it :blush:

All the users in our Discourse are automatically members of groups based on their institutional affiliation (@myuni.edu or whatever). I’ve made these institutional groups the “primary” groups. I did this because I’m using the group’s “title” field to convey users’ institutional affiliation.

Here’s what it looks like in a topic:

For various reasons, I don’t want these groups to be visible to users. So I’ve made them hidden them (using the Group is visible to all users option).

Unfortunately, when someone clicks on the institution’s name (as shown in the above screenshot) they get taken to a non-existent page (/groups/myuni or whatever). I had tested this at some point and I could have sworn that these titles became unclickable if the group was made hidden.

Next steps:

  • Do I need to re-bake all the posts (or whatever the Discourse term turns out to be)?
  • Otherwise, it would be swell if these titles can be made non-clickable when the group is not visible to users.

This has come up before. Unfortunately, the only solution at this point seems to be custom code:
https://meta.discourse.org/t/apply-css-to-all-custom-non-badge-user-titles/51376/36?u=jomaxro

4 个赞

谢谢!你第一个链接中的 JS 代码解决了我的问题。但这看起来有点像 Contribute > Bug 呢。

1 个赞

So.. don’t do that? Seems pretty expected to me. You made the primary group invisible.

2 个赞

I don’t find it that weird. Using groups seems to be the standard way of adding custom avatar flairs and if you’re creating the group only for that purpose, having it non-visible makes sense (plus there are probably more reasons to hide a group page, even it is the primary group).

Displaying the group name as a link that results in a permission error doesn’t seem expected to me.

2 个赞