Shauny
(Shaun Robinson)
February 17, 2024, 11:09pm
1
Whenever I grant a user a badge directly on a post, the “Reason” is left blank, where it should be filled in with the post URL:
That’s odd. This seems similar to this fixed bug:
discourse:main
← discourse:fix-grant-badge-reason-not-saved
opened 06:01AM - 03 Oct 23 UTC
#### Context
https://meta.discourse.org/t/grant-badge-reason-not-added-to-the-g… ranted-badge/279304
Regression from https://github.com/discourse/discourse/pull/23668 where we stopped passing in `this.badgeReason` to the badge granting function. This PR fixes that and adds a unit test to cover that code path.
#### How to Test
1. Add a badge as admin, ensure that the `Show post granting badge on badge page` option is selected before saving.
2. Grant the badge to a user with the admin interface (`/admin/users/:user_id/:username/badges`) to grant badges, with the reason filled in with a valid link to a post.
3. Check that the badge is granted with the post link displayed in the user badges index.
**Test artifacts**:
After fix:
<img width="1351" alt="Selecting Badge" src="https://github.com/discourse/discourse/assets/133760061/904da449-0459-460e-8f38-f6581565d0e7">
<img width="862" alt="Badge Granted" src="https://github.com/discourse/discourse/assets/133760061/0a81c976-63fa-4df6-b98e-3b69c192508f">
I can see you’re using the stable version, but this fix should be included.
Note: I can’t reproduce it with the latest version.
Shauny
(Shaun Robinson)
February 18, 2024, 12:05am
3
Ah. I’ve figured it out. More of a misunderstanding than a bug.
I had unchecked “Show post granting badge on badge page”.
But that setting is misleading. It doesn’t only hide it from the badge page it also hides it from admin so I can’t see the reason even if I’m an admin.
I’d like to be able to not show it on the badge page but still see it as an admin when editing a user’s badges.
Seems wrong that if the data is there, an admin cannot see it unless everyone can
Thanks
3 Likes
sam
(Sam Saffron)
February 19, 2024, 12:57am
4
I see, tagged this to the staff experience team and moved to ux
2 Likes