They are indeed system badges, and can’t be edited by the UI (though they are visible). That line would need to be added with a PR.
Mind if I try and make that PR. I think I just need to change the SQL in discourse/lib/badge_queries.rb
lines 156-167
Hello. After my badges were removed one day ago, they suddenly came back. Can someone fix this issue?
They will come back as the queries run daily and you still ‘qualify’. We would have to remove them manually every day until the bug gets fixed, which is unrealistic.
I have checked, and we can make this pr-welcome (You would need to do all three)
Got it Thanks. I should be able to do this
And I don’t see why I would need to do 3. The one for invite links is a function with returns the count if I read the function correctly.
I did not look at the code, so you may be right.
def self.invite_badge(count, trust_level)
<<~SQL
SELECT u.id user_id, current_timestamp granted_at
FROM users u
WHERE u.id IN (
SELECT invited_by_id
FROM invites i
JOIN invited_users iu ON iu.invite_id = i.id
JOIN users u2 ON u2.id = iu.user_id
WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= #{trust_level.to_i} AND u2.silenced_till IS NULL
GROUP BY invited_by_id
HAVING COUNT(*) >= #{count.to_i}
) AND u.active AND u.silenced_till IS NULL AND u.id > 0 AND
(:backfill OR u.id IN (:user_ids) )
SQL
end
Here it is. Seems like its just the 1. And looked through the whole file and nothing else with invites
Made the PR
Looking at the PR (and bear in mind that PRs aren’t my forte), it looks like you’ve hardcoded it to be just the Promoter version by changing the #{count.to_i}
to be 1
?
My example above was only a proof of concept, and would need to be adapted to suit.
(also, looking at the text in that onebox, I’m ‘JammyDodger’ not ‘Jammy Dogger’… )
My bad. Fixed your name
Thank you for your contribution! I’ve merged your PR
Also, a super small note that we typically require tests for modifications, but seeing there was none before we’ll just merge this and backfill.
Hope to see more from you in the future
This topic was automatically closed after 2 days. New replies are no longer allowed.