I thought the problem as part of User Points Contributed modules but seems not correct!

My test is posted here: http://drupal.org/node/912098#comment-3449542

I report it here:

Hi to all,

I'm making some tests with this modules and I found some bugs (I belive!)

The "Exipiring Every" modules seems have some problems:

My testing setting:

  1. Expire time:
  2. 1 hour

  3. Adding points for:
  4. registering, comment posting, admin adjust (by "Adjust" option)

  5. Transaction stamping:
  6. Unchecked

My test

No problem:
Adding point (in according with point 2) is ok!
Adding point is still works good if I set an expire time different from the default setting. Example: instead of 1 hour (point 1) I set 3 minutes.

Problems:
Expire operation seems works fine (in according with time indicated before) BUT looking at database I found something strange:
All the expire operations have themselelf an "expire date" with value of the standard Expire time (point 1) instead of a "0" for a "Never expire" value.
The same problem appear adding or subtracting points, using "Adjust" function, WITHOUT an Expire date (leaving the second data filed blank, as indicated) to obtain a permanent modify.

Considerations:
If there's a "default expire time" settings, this will be added also to all "expiring actions", generating a perpetual loop of add and subtract points.

In You need I can give an extract of my "userpoints_tx" table to controll!

I hope this could be useful for a solution!
Thanks!
Bye!

Comments

berdir’s picture

Title: Problem with Expire data! A test. » Expiry transactions use default expiration date
Version: 6.x-1.1 » 7.x-1.x-dev
Status: Active » Needs review

Confirmed and reproduced in 7.x-1.x-dev

The attached patch fixes the bug and also extends the existing tests to account for this. I will provide a backport for D6 once I've commited to 7.x-1.x-dev.

berdir’s picture

StatusFileSize
new2.84 KB

Oh. Would help if I would attach the patch.

Dret’s picture

Issue tags: +patch

Ok, thanks a lot!

I'll wait for the 6.x patch!

Bye!

BenK’s picture

Subscribing to help with testing...

BenK’s picture

Status: Needs review » Needs work

Hey Berdir,

I tested out the patch and it works great. Expiration transactions are no longer expiring themselves. So the reported issue is solved.

I thought about marking this RTBC, but then I noticed a couple other bugs related to expiration and thought we might want to tackle them in this issue. But if you would rather have me open a separate issue, let me know.

So here are the bugs/issues I noticed:

1. When points expire, the original points award transaction is getting the timestamp of the expiration transaction. And as a result, this throws off the chronological order of point transactions. It would be better if the original points award transaction kept it's original timestamp.

2. In the "Reason" column, the expiration transaction is displaying the word "expiry". Since this is user facing, we should probably have something more understandable like "!Points have expired." Better yet, is there any way to reference the original points award (or even link to the original points award) in this field? Maybe make the original points award a "parent" transaction? Perhaps it could say something like: "500 !points were added on 5/25/10. That !points transaction has now expired."

--Ben

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new6.31 KB

1) Fixed. time_stamp will only be overriden for new transactions now.

2) will be improved as part of the myuserpoints changes.

berdir’s picture

Issue tags: -patch, -expire date
StatusFileSize
new6.45 KB

Fixed a test.

BenK’s picture

Status: Needs review » Reviewed & tested by the community

The latest patch is working great! No problems at all in my testing. This is RTBC.

--Ben

berdir’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Commited, will provide a patch for D6 soon.

Dret’s picture

Ready for testing on D6!

berdir’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new4.72 KB

Ok, attaching an updated patch for D6. Thanks for testing :)

berdir’s picture

Issue tags: +userpoints backport

Tagging...

berdir’s picture

Status: Needs review » Fixed

Finally commited this.

Status: Fixed » Closed (fixed)
Issue tags: -userpoints backport

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