Alexander_Wright reports an issue where a SQL-triggered badge fails to award users despite the query preview showing matches. The badge is configured to trigger when a post contains the text ‘Give Me A Badge’, using a query on badge_posts with the condition that a user creates or edits a post. zogstrip states they cannot reproduce the issue but identifies potential bugs in the BadgeGranter component, linking to a GitHub pull request (#37674) that may resolve the problem. After Alexander_Wright confirms the issue persists, zogstrip requests more detailed information about the user’s setup to attempt further reproduction.
I’m trying to award a badge depending on the content of a post.
For example, If I type ‘Give Me A Badge’ i’m awarded the ‘Demanding’ badge.
My SQL is as follows:
SELECT p.user_id, p.id post_id, p.updated_at granted_at
FROM badge_posts p
WHERE p.raw LIKE '%Give Me A Badge%'
AND (:backfill OR p.id IN (:post_ids) )
With ‘Query targets posts’ and ‘When a user creates or edits a post’.
It’s not, however being triggered. The ’ Badge Query Preview’ shows hits for awards, but the site doesn’t appear to be awarding them.