Problem/Motivation
I'm trying to show a block listing the users with the most points earned in the past 30 days.
In 8.x I was able to do this by querying the transactions created in that time frame and aggregating the sum
in 2.0.0 each transaction is now a revision of the users userpoints entity. The total quantity is increased but we dont store the number that it was increased by in the revision.
This is preventing me from querying the total points within a specific timeframe.
Proposed resolution
Store the points being granted in a new field of the revision.
Comments
Comment #2
nico.b commentedI had the exact same problem. I agree that the module itself should be able to do this, but since that's not the case I just built a custom module with a transactions table that implements hook_ENTITY_TYPE_update() for the userpoints entity type and updates the custom table accordingly by taking the difference of the original and the new entity. Maybe that approach would also work for you.