Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On my site, creating a node gives you 10 userpoints. Users also get 5 points on editing the node. When I create a new node, I get:
You just earned 10 points and now have 1437 points in the General category.
You just earned 5 points and now have 1442 points in the General category.
You just earned 5 points and now have 1447 points in the General category.
What is causing this?
Comments
Comment #1
BerdirCheck your My userpoints page, it should tell you exactly how many points you are getting for what.
Also, I assume you're using the Userpoints Nodes and Comments modules? You should move the issue over there...
Comment #2
thoughtcat CreditAttribution: thoughtcat commentedThanks Berdir - having looked at my userpoints I am seeing 10 points for the creation of the node followed immediately by 5 points for editing it and then another 5 points for editing it, all within the same few seconds. I didn't edit it after creating it.
Could this be related to new rules I've just set up to generate an automatic node title and URL path for new nodes on creation? (These rules were created to fix bugs in Automatic Nodetitles.)
Comment #3
BerdirRight now, every node save counts as an edit. Sounds like your rules re-save the node twice. I assume your rules use the "after a new node was saved" event? (don't remember the exact name, might be slightly different) Then you can alter the node before the initial save. This would also be better for performance. Isn't always possible, though, e.g. if you're depending on something that's only available after saving.
You can also try the nc_revision module, configure the node type to automatically create a new revision and give users points for new revisions, not edits.
The 6.x version of this module had the ability to configure how much of the node body needs to change to give new points. This is however much more complicated to implement in 7.x due to all the flexibility from fields so we didn't re-implement that feature yet.
Comment #4
thoughtcat CreditAttribution: thoughtcat commentedHi, thanks for your help! I've raised a support request on the Rules module as I've found that turning off one of the rules (although not all) solves the problem.