I have the following two versions of the modules installed
User Points 6.x-1.0
User Points Contributed modules 6.x-1.x-dev (2009-Jan-30)
I have images, points and roles configured. I set up a new role "member" so a new user with 5 points would have a member badge and this would not conflict with the general authenticated user role since we also have an admin badge.
1. When I add points to a user account to test the points show up just fine but the badge level never changes to match what we set up for the point level. We have checked permissions etc and cannot seem to figure out what I am doing wrong.
Thanks for any help!.

CommentFileSizeAuthor
#10 userpoints_badges.zip1.94 KBvenusrising

Comments

jredding’s picture

Project: User Points » User Points Contributed modules
Version: 6.x-1.0 » 6.x-1.x-dev
Component: Code: userpoints API » Code: userpoints_badges

as with the last bug reported this is classified incorrectly. The bug is with userpoints_badges.

If you do not classify the issues correctly you will not notify the knowledgeable parties.

venusrising’s picture

Do I need to re-write this report in a different area or has it been moved?

kbahey’s picture

No, you don't need to report it elsewhere.

As explained on the project page, this project is composed of many modules, each with a different maintainer.

Hopefully the correct maintainer will have time to review this report, or other users of that module can offer their help.

jredding’s picture

its in the right place now.

Militopedia’s picture

Hello,

I am having the same problem. I hope that there will be a solution to this soon and would be very grateful for that as I think this is a great way to integrate two excellent modules.

Thanks,
Roger

venusrising’s picture

Priority: Normal » Critical

Does anyone have any idea what is causing this, we really need to module and have tried checking through the code but still cannot find a clue. Any help would be appreciated.

venusrising’s picture

Does anyone have any idea what is causing this, we really need to module and have tried checking through the code but still cannot find a clue. Any help would be appreciated.

kbahey’s picture

Setting it to critical will not help.

This module was written by BTMash. Try to contact him here http://drupal.org/user/60422 and point him to this issue.

Be patient.

venusrising’s picture

Thanks for the idea, per your suggestion I did send him the link to this post. I will post anything I find out.

venusrising’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new1.94 KB

I had lyricnz on Drupal IRC help me and he fixed this issue. I don't know how to do patches etc so I will just upload the correct module file.

The code to correct it is

add
$uid = $params['uid'];
above the line that starts $total_points = userpoints_get_current_points(..)

about line 118 of userpoints_badges.module

kbahey’s picture

Priority: Critical » Normal
Status: Reviewed & tested by the community » Fixed

Fixed in 6.x-1.x-dev. Will be available when the new tar ball is build tomorrow morning 8 am Eastern.

lyricnz’s picture

Status: Fixed » Needs review

kbahey: missed one more $uid on line 121 - user_badges_user_add_badge($uid, <====

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/userpoints_...

kbahey’s picture

Status: Needs review » Fixed

Thanks, got it.

Militopedia’s picture

Hi,

I have changed the two lines as indicated by lyricnz. I cleared the cache but the badges are still not updated.

Have I missed something that I should have done so that the changes take effect?

Thanks,
Roger

lyricnz’s picture

This module does NOT reprocess existing users to check for which badge they should have, it simply responds to the "user X userpoints have changed" event, and updates their badges. It does, however, reprocess users if you edit the badge definitions - this may be enough for your application?

sagar ramgade’s picture

Hi..shanon..wat i think that u ve not configured the module properly..may be badges are not configured properly..m willing to help you jus need to clarify few things..is the role changing when userpoints threshold is reached if yes then 4 sure badges modules is not configured properly..i ve tested on ma sandbox server..please give da configuration..wil certainly help you with this issue..

lyricnz’s picture

What do you mean "I have changed the two lines as indicated by lyricnz"? My fix was to add _one_ line:

Add

$uid = $params['uid'];

above the line that starts

$total_points = userpoints_get_current_points(..)

Or you could get the latest -dev release, which has this bug fixed.

kbahey’s picture

You do not need to change code. The -dev tarball has the changes that lyricnz fixed.

Try the 6.x-1.x-dev tarball, and report back if it works or not here.

Militopedia’s picture

Hello,

OK, I have uploaded the latest 6.x-1.x-dev module file, emptied cache and edited the badge definitions (is it enough if I just change the badge pictures and save?). However, still the same badges are shown even though a user has enough userpoints to receive the next higher badge.

I then went to the profile page of a user and set the badge manually. However, I noticed the following:

Let's say there are 10 badges No.1 to No.10. The user currently has No.1 but should have No.5. When I set No.5 manually via the profile-tab and save it only goes to No.2 (the check box is marked). I had to repeat this step 5 times until it got to No.5 where I wanted to have it.

Do I have to uninstall the module completely and reinstall it that the changes take effect? Or does it still not work retrospectively but only if now users get new userpoints and cross a threshold to get the next higher badge?

Thanks,
Roger

Militopedia’s picture

Hello,

OK, I figured it out now. I had the "wrong" weights assigned to my 10 badges. After I changed to order from 1-10 to 10-1 the badges are assigned correctly.

Thanks,
Roger

Status: Fixed » Closed (fixed)

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