# Bug when editing badges - Trigger is changed

**URL:** https://meta.discourse.org/t/bug-when-editing-badges-trigger-is-changed/323620
**Category:** Bug
**Tags:** badges, fixed
**Created:** [August 27, 2024, 5:49pm UTC](https://meta.discourse.org/t/bug-when-editing-badges-trigger-is-changed/323620 "2024-08-27T17:49:37Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Shauny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shauny/32/362012_2.png) [@Shauny](https://meta.discourse.org/u/Shauny)
#### Post date: [August 27, 2024, 5:49pm UTC](https://meta.discourse.org/t/bug-when-editing-badges-trigger-is-changed/323620/1 "2024-08-27T17:49:37Z")

</div>

When editing an existing badge, the Trigger is changed so it always goes back to:

> When a user changes trust level

Very annoying for editing lots of badges!

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [August 28, 2024, 2:00pm UTC](https://meta.discourse.org/t/bug-when-editing-badges-trigger-is-changed/323620/3 "2024-08-28T14:00:34Z")

</div>

I haven’t been able to repro this, are you able to give me more details, maybe give me a repro from scratch please, or a video?

---

<div class="post-metadata">

### Author: ![Shauny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shauny/32/362012_2.png) [@Shauny](https://meta.discourse.org/u/Shauny)
#### Post date: [August 28, 2024, 3:36pm UTC](https://meta.discourse.org/t/bug-when-editing-badges-trigger-is-changed/323620/4 "2024-08-28T15:36:01Z")

</div>

OK, I use the API to grant forum badges based on what people do on my site [https://tardis.guide](https://tardis.guide)

So then I added a Badge Query which is impossible to earn to all of those badges, just so the badges don’t show up in the list for ‘granting badges’ - it was clogged up and I never needed them there.

So all my badges contain this SQL:

> SELECT id user\_id, created\_at granted\_at  
> FROM users  
> WHERE id = -1000

(This is the only way I know of to remove a badge from that dropdown list).

I set the trigger to “updated daily” just because it’s one that works.

But since the update, any time I edit a badge (maybe to change the description or the picture), the trigger value has changed to the first option because when I try to hit submit it says this:

 ![Screenshot 2024-08-28 at 16.34.14](https://global.discourse-cdn.com/meta/original/4X/f/b/b/fbb7f8710e80e2478adcfece0c526126d72191f1.png)

And when I look, yes the trigger has changed to “when a user changes trust level”:

 ![Screenshot 2024-08-28 at 16.34.51](https://global.discourse-cdn.com/meta/original/4X/2/3/e/23e46ad42afe2700c27c28c03fb59cc132136b0c.png)

So I change it back to ‘updated daily’ and hit submit and it works.

But then if I simply refresh the page, it will go back to ‘when a user changes trust level’ so I can’t edit it without fixing that again.

Thanks

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [August 28, 2024, 3:38pm UTC](https://meta.discourse.org/t/bug-when-editing-badges-trigger-is-changed/323620/5 "2024-08-28T15:38:00Z")

</div>

Will try to look at this tomorrow and see if I can repro with these info, thanks.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [September 2, 2024, 6:46pm UTC](https://meta.discourse.org/t/bug-when-editing-badges-trigger-is-changed/323620/7 "2024-09-02T18:46:29Z")

</div>

I still haven’t been able to reproduce your exact issue, but I suspect this might help:

[https://github.com/discourse/discourse/pull/28686](https://github.com/discourse/discourse/pull/28686)

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [September 11, 2024, 11:35pm UTC](https://meta.discourse.org/t/bug-when-editing-badges-trigger-is-changed/323620/9 "2024-09-11T23:35:07Z")

</div>


