# לא ניתן להעניק תג מותאם אישית עבור שדה סיבת ריק

**URL:** https://meta.discourse.org/t/unable-to-grant-custom-badge-for-non-empty-reason-field/82299
**Category:** Bug
**Tags:** subfolder
**Created:** [6 במרץ,‏ 2018,‏ 9:40am UTC](https://meta.discourse.org/t/unable-to-grant-custom-badge-for-non-empty-reason-field/82299 "2018-03-06T09:40:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ivan\_Rapekas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivan_rapekas/32/248924_2.png) [@Ivan\_Rapekas](https://meta.discourse.org/u/Ivan_Rapekas)
#### Post date: [6 במרץ,‏ 2018,‏ 9:40am UTC](https://meta.discourse.org/t/unable-to-grant-custom-badge-for-non-empty-reason-field/82299/1 "2018-03-06T09:40:19Z")

</div>

Hi, I checked latest both stable `1.9.3+2` and `test-passed` and realized that custom badge cannot be granted to user if the reason field is not empty.

Steps to reproduce:

1. create a new simple badge using font-awasome icon, without SQL
2. go to admin/users, find desirable user
3. click `Edit badges`
4. select the badge created
5. type a reason (important!) `https://www.cuba-platform.com/discuss/t/redirecting-http-to-https/3977/4`
6. click `Grant`
7. you’ll get an error, see details below in the picture.

If the reason field is empty, there is no error.

My forum is in a subfolder, probably that’s a reason of the fail:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/0/e02bf06cf7d55a5b1313fdf053bb72cfabbd1eb9.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [7 במרץ,‏ 2018,‏ 1:50am UTC](https://meta.discourse.org/t/unable-to-grant-custom-badge-for-non-empty-reason-field/82299/2 "2018-03-07T01:50:09Z")

</div>

> [@Ivan\_Rapekas](#):
>
> My forum is in a **subfolder** , probably that’s a reason of the fail:

This looks incredibly likely to be the reason, unable to repro on non-subfolder.

---

<div class="post-metadata">

### Author: ![saurabhp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saurabhp/32/125182_2.png) [@saurabhp](https://meta.discourse.org/u/saurabhp)
#### Post date: [31 בדצמבר,‏ 2018,‏ 8:10am UTC](https://meta.discourse.org/t/unable-to-grant-custom-badge-for-non-empty-reason-field/82299/3 "2018-12-31T08:10:57Z")

</div>

Hi,  
I was able to find the issue. I found it out after seeing that we were returning 404 in the first screenshot instead of 400. We were not taking care of relative\_root\_url while parsing reason of badge.

I have created PR for the same here:  
[https://github.com/discourse/discourse/pull/6836](https://github.com/discourse/discourse/pull/6836)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [11 בינואר,‏ 2019,‏ 7:00am UTC](https://meta.discourse.org/t/unable-to-grant-custom-badge-for-non-empty-reason-field/82299/4 "2019-01-11T07:00:29Z")

</div>

This has been merged. Thank you @saurabhp!

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [14 בינואר,‏ 2019,‏ 10:00am UTC](https://meta.discourse.org/t/unable-to-grant-custom-badge-for-non-empty-reason-field/82299/5 "2019-01-14T10:00:07Z")

</div>

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