Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Plugins by
Running MySQL 5.1, Apache 2.2, PHP 5.2, shared hosting.

Downloaded Dec 12th 2011 github.com version of Noah's badges plugin. When upvoting on a question, occasionally see the following error with javascript turned off:


Question2Answer query failed:

INSERT INTO qa_userbadges (awarded_at, notify, object_id, user_id, badge_slug, id) VALUES (NOW(), 1, 75, NULL, _utf8 'nice_answer', 0)

Error 1048: Column 'user_id' cannot be null


If javascript is on, for reference, the error says "A database error occurred." With phmyadmin, I can see that the qa_userbadges table exists.

I tried "Recreate badges" and "Recheck badge awarding" with box checked ("Remove all badges from database first"), but this didn't fix it.
Q2A version: 1.4.3

1 Answer

+1 vote
Not sure what is wrong, but I've added a check that should stop it from trying to award badges without userid.  Try with latest code.