Reassigning to a group creates a /u/ link in the @group mention

AI-generated summary

A bug was found in the official Assign plugin where reassigning a topic to a group creates a /u/ link in the @group mention instead of /g/. Canapin provided steps to reproduce the issue and included a screenshot for reference.

Arkshine suggested that the issue is due to a missing line of code, api.addGroupPostSmallActionCode("reassigned_group");, in the plugin’s JavaScript file. Canapin confirmed that adding this line fixes the issue.

Sam requested a pull request (PR) to address the issue, and Arkshine submitted a PR to fix the bug. Sam thanked Arkshine for resolving the issue.

It’s a small bug :bug: in the official Assign plugin.

Steps to repro:

  1. Assign a topic to yourself

  2. Click “Unassign…”

  3. Click “Edit assignment…”

  4. Choose a group and click “Edit”

  5. The @group mention from the small action message links to /u/ instead of /g/.

For example:

image

@cherries here links to /u/cherries instead of /g/cherries.

It only happens in reassigns, not in assigns.

2 Likes

It looks like it misses api.addGroupPostSmallActionCode("reassigned_group"); here:

Related Discourse code:

https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/widgets/post-small-action.js#L12-L27
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/widgets/post-small-action.js#L82-L84

2 Likes

I added this line on my dev install and it indeed seems to fix the issue :+1:

2 Likes

Awesome, would you be able to submit a PR :hugs:

3 Likes

Sure!

https://github.com/discourse/discourse-assign/pull/468

3 Likes

Thanks @Arkshine !!!

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