I have the following use case: A user is able to "get" points for some reason and is able to spend them on different activities. Where the minimum amount should be 0 points.
Normal behavior (with one category of points):
1.- A user gets 100 points with an expiration date
2.- The user spend some points and now has 70 points
3.- On the expiration date the module will calculate the new amount as 70-100 = -30
Normal behavior (with two or more categories of points):
1.- A user get 100 points in category A (no expiration )and 300 points in category B (expiration). (A: is the default category)
2.- The user spend some points of category B and now has 170 points.
3.- On the expiration date the module will subtract 300 points of category B from 100 points of category A.
The final result will be: Category A -200 and category B 170 points.
The patch below will result in:
Modified behavior (with one category of points):
1.- ...
2.- ...
3.- On the expiration date the resulting amount will be 0 points.
Modified behavior (with two or more categories of points):
1.- ...
2.- ...
3.- The final result will be 100 points of category A and 0 points of category B.
The patch considers the problem described here #1477900: Expiration of categorized userpoints goes to Uncategorized, which is similar.
It adds a simple on/off switch to the modified behavior in admin/user/userpoints/expiration.
PD: please have in mind that this is my first patch
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | userpoints-expiration-mode_v4.patch | 2.9 KB | sapox |
| #4 | userpoints-expiration-mode_v3.patch | 2.89 KB | sapox |
| #3 | userpoints-expiration-mode_v2.patch | 2.89 KB | sapox |
| #2 | userpoints-expiration-mode.patch | 2.89 KB | sapox |
| userpoints-expiration-mode.patch | 3.01 KB | sapox |
Comments
Comment #2
sapox commentedUpdate for re-testing
Comment #3
sapox commentedNow?
Comment #4
sapox commented...
Comment #6
sapox commentedFormat is killing me.
Comment #6.0
sapox commentedMistake in example
Comment #6.1
sapox commentedexample fix
Comment #7
manuel.adanClosing this as outdated, 6.x version is no longer maintained.