Closed (duplicate)
Project:
User Badges
Version:
6.x-1.6
Component:
User interface
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Nov 2010 at 20:11 UTC
Updated:
30 Apr 2011 at 11:46 UTC
I have my user badge setting, set to only show the top 2 user badges. But on my Author Pane in my forum, all badges are showing up. Also, in the admin area it is only showing the top 2 badges. This makes things difficult to assign/create rules, when you have to go back and forth to shut the "show top Badges" back off.
Author Pane - Show top badges does not work. Which is not ideal
Admin area - Show top badges does work. Which is not ideal for creating new rules, etc.
Comments
Comment #1
soup1977 commentedno one else is having this issue?
Comment #2
darkdimI have the same problem. In the setting is the number one badge, and the author pane few badges.
Comment #3
michelleThe code is hosted in AP but I neither use nor support it. The function it uses is user_badges_for_uid(). If there is a better function to use to respect this setting, patches are welcome.
Michelle
Comment #4
Numline1 commentedIt may be realted to error which occurs after setting max. badges number: http://drupal.org/node/964546
Comment #5
venusrising commentedI too have the issue where it is now show ALL badges when we only wanted it to show one which was working great prior to the update, does anyone know if there is new code to replace that has changed since prior?
Comment #6
nancydru@numline1: if it is related to #964546: $account->badges_all issue, then there is a simple fix over there to be tested.
@venusrising: do you mean the update from UB 1.5 to 1.6?
Comment #7
soup1977 commentedhttp://drupal.org/node/964546 this is not related to this issue.
http://drupal.org/node/964546#comment-3771240 I tried this fix and The Author pane is still showing all badges regardless of setting. Maybe I need to put this issue on the Author Pane project page??
Comment #8
michelle@soup1977: I already answered in #3. If you move it to AP's queue without a patch, it's just gonna sit there.
Michelle
Comment #9
soup1977 commentedI wish I was savvy enough to provide a patch, but I'm not. That's why I'm looking for help. At some point maybe someone else will run into it and have the brains to fix it, until then I guess I'll create a view to use instead of using the Author Pane module.
Comment #10
venusrising commentedHas anyone had any luck getting this fixed? I rolled it back to prior version and it fixes the multiple badge display in user badges.
Comment #11
venusrising commentedThe code authorpane is using is
if ($account_id != 0) {
$variables['user_badges'] = user_badges_for_uid($account_id);
}
has this code changed in the most stable release of user badges? We have both of these running on a live site so we really need some info so we can roll to current user badges stable.
I can test on a dev site Nancy if you how this is being called has changed
Comment #12
ressaThe dev version from 2010-07-11 version = "6.x-1.x-dev" only shows one badge, if that is the setting of "Number of badges to display".
The latest dev version from 2010-Dec-11 shows all badges, on some pages, but not all.
Comment #13
nancydruYes, there was a change in that code to support the "No badges" message feature (#892996: If no badges are assigned display message saying that "No badges have been earned" or equiv). You can try setting that message to something and see if this becomes at least consistent.
Comment #14
EoinBailey commentedThe quick fix to this is to edit out the following three lines:
These are found at line number 758 in the user_badges.module file - in function "user_badges_get_badges".
Removing this line forces the "user_badges_get_badges" function to check the limit again for that user (and every user in fact). I think the issue is a minor caching problem with the user badges module.
Comment #15
nancydruThat was done for #945280: Reduce queries which was a significant performance issue, so it would be better to find out why that seems to be messing you up.
Comment #16
venusrising commentedIf Authorpane uses uses is user_badges_for_uid() is this still the correct way to call User Badges per the User Badges update code? I tried to provide the code for AP I found in the module page but am not a coder but can test on a dev site if someone from user badges can suggest another way to call in the code to authorpane.
Comment #17
Wolfgang62 commentedAny news on this one?
I removed the 3 lines code but doesn´t help. Still showing more than 1 badge.
Comment #18
Simon.Smithson commentedI'm also having the same issue on a production site. I've had a look through the code, and as far as I can see everything looks logical. Any bright ideas?
Comment #19
venusrising commentedI have scoured the code too and do not see any reason for the issue but can test if someone has any ideas.
Comment #20
soup1977 commentedI've dug through what I could as well, and have found nothing. Obviously it is something, but I'm not sure what it could be.
Comment #21
nancydruIt's even harder for me since I don't have an Author Pane.
Comment #22
venusrising commentedWell if someone has an idea I am happy to test or paste code
Comment #23
LynnS commentedSubscribing. I'm not using AP and all badges are displaying even though I've specified one. This completely ruins the module for my use. I've had to turn the damn thing off. I switched to dev hoping it had been addressed, but no va.
Comment #24
michelle@NancyDru: You don't need Author Pane. All I need to know is this: Given the UID of the viewer and the UID of the person with badges, what function will return the badges that the viewer should be seeing?
This is the code AP is using:
$variables['user_badges'] = user_badges_for_uid($account_id);If that's not the correct function, what is? I'd be happy to change it but I don't use User Badges and am not going to go hunting through the code to find it. Either Nancy or someone who cares about using them together needs to dig in and tell me what function to use. Keep in mind that the result is printed as is in the template so, if it's a theme function that's needed, I need to know that one.
@LynnS: This issue is about the UB/AP integration. If you're having problems outside of AP, please start a new issue.
Michelle
Comment #25
venusrising commentedI upgrade to the new stable Author Pane and left User Badges at 6.x-1.5 (since we had to roll back when issues arised) and it works fine. Have not tried to re-up UB yet as the site is production and we are concerned about issues.
Comment #26
venusrising commentedCan someone from user Badges kindly comment on this? Please thanks
Comment #27
ressaHave you tried digging up the dev version from 2010-07-11, "6.x-1.x-dev"? It only shows one badge, if that is the setting of "Number of badges to display".
Comment #28
venusrising commentedNo because the prior stable release works so we just rolled back as the site is live
Comment #29
michelleSomeone put a patch over in my queue. If you want it to get in, please test: #1142226: user_badges variable show all badge instead of the right badge number set in the badge settings page
Michelle
Comment #30
venusrising commentedMichelle
Will give it a go tomorrow and see what happens.
Comment #31
venusrising commentedMichelle-
I did the patch and it solved the problem for us too.
Comment #32
michelle