I'm not sure why this would be happening. I'm getting the following error when I save the roles on the roles page:

<?php

user warning: Duplicate entry '3-4-role' for key 1 query: INSERT INTO sslab_user_badges_user (uid, bid, type) (SELECT uid, 3, 'role' FROM sslab_users_roles WHERE rid=5) in /home/sporbcom/public_html/drupal6/sites/all/modules/user_badges/user_badges.module on line 612.

?>

There are three roles on the site that share the same badge (bid 3) as this user... but this user only has one role (outside of authenticated user). Checking in the user_badges table i see that this user id 3 has one badge associated with him, bid 3. Perhaps this is causing the issue?

This happened for me with the last two 6.x versions and 6.x.dev which I just installed this morning.

Comments

Richard Blackborder’s picture

Status: Active » Fixed

This was a messy, awkward error to solve, mainly thanks to postgresql.

Anyway, the new dev version dated today should fix it, although the queries are going to run a little bit slower because of the checking that needs to be done.

If you could install that dev and see if it fixes things, that would be a helpful contribution to fixing the module. Thanks!

vood002’s picture

I've installed and tested the new version and the error I was receiving is indeed gone. Thanks a bunch!

Richard Blackborder’s picture

Glad to hear it :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.