Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Richard Blackborder CreditAttribution: Richard Blackborder commentedThis 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!
Comment #2
vood002 CreditAttribution: vood002 commentedI've installed and tested the new version and the error I was receiving is indeed gone. Thanks a bunch!
Comment #3
Richard Blackborder CreditAttribution: Richard Blackborder commentedGlad to hear it :-)