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!
A user reports a bug where editing a badge in Discourse reverts the trigger setting to âWhen a user changes trust level,â even after manually changing it back. The issue occurs when editing badges that use a custom SQL query to prevent them from appearing in the badge granting list, with the trigger set to âUpdated daily.â The user explains that the trigger resets upon page refresh, making editing cumbersome. Another user acknowledges the issue and references a related pull request that may address it. Shauny details the steps to reproduce, while j.jaffeux confirms the bug and plans to investigate further. j.jaffeux notes the issue remains unresolved but suspects a fix may be in progress via a GitHub pull request.
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!
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?
OK, I use the API to grant forum badges based on what people do on my site 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:
And when I look, yes the trigger has changed to âwhen a user changes trust levelâ:
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
Will try to look at this tomorrow and see if I can repro with these info, thanks.
I still havenât been able to reproduce your exact issue, but I suspect this might help: