# Title disappears when user sets it

**URL:** https://meta.discourse.org/t/title-disappears-when-user-sets-it/160912
**Category:** Bug
**Created:** [August 14, 2020, 6:42pm UTC](https://meta.discourse.org/t/title-disappears-when-user-sets-it/160912 "2020-08-14T18:42:41Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![HeyRR](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heyrr/32/192157_2.png) [@HeyRR](https://meta.discourse.org/u/HeyRR)
#### Post date: [August 20, 2020, 8:03pm UTC](https://meta.discourse.org/t/title-disappears-when-user-sets-it/160912/8 "2020-08-20T20:03:50Z")

</div>

Thanks, I can see the badge is still there after rerunning the `BadgeGrant` job.

However, it seems there’s another issue related to this `BadgeGrant` job. I used to manually bulk assign some badges(eg. give out first like or receive first like) to users who cannot get it automatically because such like is given or received in restricted category.

> [@Badges not being granted for restricted categories](https://meta.discourse.org/t/badges-not-being-granted-for-restricted-categories/68141):
>
> I have a strange behavior on my forum. Basic badges (such as first like, first emoji etc.) that should be grated to users are not granted. Only admin users are granted these badges, while normal users are not. So for example, I can login as a normal user, and like as many posts as I want, and use as many emoji’s as I like, but I still won’t see the “First Like” and “First Emoji” badges. Thing is, there are certain early users that successfully got these badges. But recently all new users won…

but when the `BadgeGrant` job was triggered, all users who get such badge from manually bulk assign will lose it.

My Tests:

1. Manually assign a default badge which a user cannot get it automatically due to restricted category issue but he/she meets the requirement. Badge will be removed after running `BadgeGrant`.

2. Create a customized badge with some SQL, e.g. grant this badge when user post new topic in a specific category. Manually assign this badge which a user cannot get it automatically due to restricted category issue but he/she meets the requirement. Badge will be removed after running `BadgeGrant`.

3. Create a customized badge, no SQL. Manually assign this badge which a user cannot get it automatically due to restricted category issue but he/she meets the requirement. Badge stays after running `BadgeGrant`.

I guess this is the correct behavior as all those manually granted users does not meet the SQL query and hence will be kicked out from candidate group. But if that’s the case then most discussion in below topic will make much less sense for forums which has very active restricted categories. Also, to my understand, short-term solution becomes impossible.

> [@Some common badge queries](https://meta.discourse.org/t/some-common-badge-queries-idea/31859):
>
> warning Enabling Badge SQL entails security and performance risks so it is not available by default. For more information, see: [Enable Badge SQL](https://meta.discourse.org/t/badge-sql-can-no-longer-be-edited-by-default/47894) Here are some common badge queries which you can use to create your own awesome badge! Grant a badge if user has created at least one topic in the “foo”\* category \*(“foo” is the category name, not the category slug) SELECT p.user\_id, min(p.created\_at) granted\_at, MIN(p.id) post\_id FROM badge\_posts p JOIN topics t ON t.id = p.topic\_id WHERE cate…

Any suggestion here? I can simply stop doing that but just curious if there’s a way to deal with it.

---

_[View the full topic](https://meta.discourse.org/t/title-disappears-when-user-sets-it/160912)._
