Closed (fixed)
Project:
User Badges
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Apr 2010 at 00:32 UTC
Updated:
20 Jun 2013 at 07:27 UTC
Other issues filed on the User Badges queue appear to be problems with other contrib modules, not User Badges
#258403: Badges Not Showing Up on User Profile Until After Role is Re-Applied
In this case I am using "User-Selectable Roles" on registration
with latest 6.x-1.x-dev of User Badges from 2009/10/08
the User Badges do not appear on the user profile for newly registered users until I manually resave the role assignments in the User Badges admin
Comments
Comment #1
johnhanley commentedI'm not sure what to make of this. Roles selections made by a user during registration via User-Selectable Roles are added to the user object and saved during account creation using Drupal core functionality. In other words User-Selectable Roles doesn't do anything tricky or proprietary to insert the roles. So the statement that the problem is caused by other contributed modules and not User Badges is purely subjective. That said, I'm willing to accept a patch or fix snippet to make User-Selectable Roles compatible w/ User Badges.
Comment #2
decibel.places commentedWell, I think it probably is the User Badges module causing the problem - I was just fishing for a solution/patch whatever here
will update here once it's corrected
thinking about using Rules to save User Badges roles when a role is updated...
Comment #3
decibel.places commentedI added a Rule for every role/badge for add and remove, which update the profile badges properly
I considered writing a custom PHP condition and action so I would only need one pair, but it was easy (if mindless) to clone the Rules
here is example add Rule:
here is the remove Rule for the same role:
Comment #4
johnhanley commentedAwesome--thanks so much for sharing your workaround.
I will leave this thread open for now in case someone identifies a solution to make this unnecessary.
Comment #5
nancydruMay be related to #739422: "Blocked" badge doesn't get assigned to recently blocked users.
Comment #6
nancydruPlease try the latest and let me know if this is still happening. Meanwhile, you might want to keep an eye on #782430: Rules integration.
Comment #7
nancydruComment #8
Q2U commentedI spent the better part of yesterday trying to get User Badges to work with Role assignments. I started by uninstalling Auto Assign Role and Auto Assign Role was not installed during my experiments. I uninstalled user_badges-6.x-1.6 (2020 Nov 15) and then reinstalled user_badges-6.x-1.6. I then uninstalled user_badges-6.x-1.6 (2010 Nov 15) and installed user_badges-6.x-1.x-dev (2010 Nov 30). I must have cleared the cache 100 times and tried every possible combination of settings. Alas, no matter what I tried User Badges would not appear on the user profile for newly registered users until I manually resaved the role assignments in the User Badges admin > Roles. After 8 hours I gave up and I am now trying to use Rules to add and remove badges when user Roles change. BTW, User Badges is a teriffic mod and it would be a major plus to see User Badges play well with Roles. Thanks.
Comment #9
nancydruIn addition to the patch above, there is another patch you might be interested in at #782430: Rules integration. They both need review.
Comment #10
Q2U commentedNancy, you wrote: "In addition to the patch above..." but I do not see any patches in this thread, unless I'me being stupid again. Is there a patch here that I'm missing?
Comment #11
Q2U commentedComment #12
nancydruIn #3 (#774244-3: User Badges do not update/add/delete until roles are re-saved in User Badges admin). Well, not really a patch, but code additions.
Comment #13
Q2U commentedThat is an exported Rule, not a code addition...no? Anyway I tried that and no workee. (
Comment #14
vkareh commentedI had a similar problem and the patch in #1092920: New users get Admin-badge assigned fixed it for me. This is for the latest 6.x-1.x-dev.
Comment #15
NeoID commentedEven though I have the patch applied from post #14, the problem is still there.
Comment #16
scarr commentedI'm also having this issue - subscribing.
Comment #17
nancydruIn working on getting a D7 version functioning, I discovered that the roles code is really wacky and really not the way things should work, IMHO. So before I go postal and rip most of that code out, let me ask:
A. If role badges always showed last (rightmost) in the list, would that be okay?
B. If A, should role badges be subject to the "Number of badges to display" limit?
Comment #18
nancydruDuplicate: #1080566: Badge not being assigned on auto user creation - has an untested patch.
Comment #19
nancydruSee also #1319230: D7 Role badges, User weighting, Limit count (6.x users take note)
Comment #20
marcoBauli commentedPatch at #18 seems already committed, but does not solve the problem. Giving a try to the Rules solution at #3 (crossfingers)
Comment #21
shabana.navas commentedFixed in Version 7. Please upgrade to Version 7.x-3.x.