# Motivo da concessão do emblema não adicionado ao emblema concedido

**URL:** <https://meta.discourse.org/t/grant-badge-reason-not-added-to-the-granted-badge/279304>\
**Category:** Bug\
**Tags:** badges\
**Created:** [17 Setembro , 2023 17:23 UTC](https://meta.discourse.org/t/grant-badge-reason-not-added-to-the-granted-badge/279304 "2023-09-17T17:23:43Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)\
**Post date:** [9 Outubro , 2023 05:59 UTC](https://meta.discourse.org/t/grant-badge-reason-not-added-to-the-granted-badge/279304/8 "2023-10-09T05:59:03Z")

</div>

Obrigado pela correção 🥳 Funciona muito bem 🙂

> <https://github.com/discourse/discourse/pull/23753>
>
> \#### 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"\>

---

_[View the full topic](https://meta.discourse.org/t/grant-badge-reason-not-added-to-the-granted-badge/279304)._
