10 accepted answer badge giving an error?


(Siraj Mahmood) #1

Recently we add answered solved plugin in our discourse forum and also add their badges as described [here][1].

1 accepted badges working pretty good but 10 accepted answer badge (Tech Support) not working, it is returning error, see the below snapshot of the error.

We are using this code:

    SELECT id user_id, current_timestamp granted_at
FROM users
WHERE id  IN (
       SELECT p1.user_id 
       FROM post_custom_fields pc
       JOIN badge_posts p1 ON p1.id = pc.post_id
       JOIN topics t1 ON p1.topic_id = t1.id
       WHERE p1.user_id <> t1.user_id AND 
                    name = 'is_accepted_answer' AND 
            p1.user_id IN (
                   SELECT user_id 
                   FROM posts 
                   WHERE :backfill OR  p1.id IN (:post_ids)
            )
        GROUP BY p1.user_id
        HAVING COUNT(*) > 9
)

Please help me because when we try to preview this code implementation so it is returning an error.
Thank you.
[1]: Discourse Solved (Accepted answer plugin)


(Siraj Mahmood) #2

Is there anyone, who can assist me?


(Sam Saffron) #3

untick “Query targets posts”


Badge not working
(Siraj Mahmood) #4

Now it is working but I already got 15+ accepted answer but still not get this badge??


(Sam Saffron) #5

Badges run daily, wait up to 24 hours.


(Siraj Mahmood) #6

Thank you @sam for such a cooperative reply :blush:


(Régis Hanol) #7