Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
  • Register
Welcome to the Q&A for Question2Answer.

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

Badges plugin bug - upvote leads to "database error"

0 votes
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
asked Dec 12, 2011 in Plugins by proteinfolder

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.
answered Dec 15, 2011 by NoahY