How to prevent "ownership loss" when a book node ( i.e. book page or wiki page) created by user A is edited by user B ?

What happens :
User A creates one book page - gets 100 points
User B edits this page ( as anyone is free to edit wiki type page) - B now gets 100 pts, A gets -100 pts

What ideally should have happened :
Ideally points should not be deducted from A , B may or may not get points on an edit

Comments

kbahey’s picture

Category: support » feature

For these type of scenarios, I think a new module for those collaborative content types (wiki, book) should be created that awards people for editing, but not subtract anything from previous editors.

Then in userpoints_basic, you set 0 for those types of content, and all is good.

minesota’s picture

How to create the new module ? Do you mean that the Point Categorization form should be used along with Userpoints taxonomy ?

Since I faced the issue only with book or wiki I did one thing ( after I posted this issue I found it )

      // subtract from the original node owner
        $params = array(
          'points' => -$points,
          'uid' => $up_orig_uid,
          'operation' => 'Ownership loss',
          'entity_id' => $node->nid,
          'entity_type' => 'node'
        );
  //      userpoints_userpointsapi($params); 

I commented out the line userpoints_userpointsapi($params); . This apparently does the thing for me, though I need to test more. Can you suggest if I am doing anything grossly wrong ?

kbahey’s picture

You need to know Drupal's API as well as userpoints API in order to write a module.

What you did in the change to the module will affect all node types, not just wiki and book.

As I always say, we need generic solutions, whether modules or options, not just hacks.

minesota’s picture

Yes thats true, it will affect all node types.
In this case, only node type 'book' can be edited by another user who is not owner, other node types can be edited only by the owners. So it sort of solved the problem dirty way.
This is obviously not the proper solution, yes , we need generic solutions.

Vuds’s picture

Hello,

My vision is that this one (transfer points because editing) should have an option to disable it and let just the original node creator earn points.

It could also be linked with #159486: Userpoints for create revision, which I'm going to make a patch until mid Jan/2009.

berdir’s picture

Status: Active » Closed (won't fix)

Sorry for spamming the participants in this issue. Due to the release of Drupal 7 and the lack of time from the maintainers, I'm closing all remaining 5.x issues for Userpoints.

Feel free to re-open this issue or create a new one for 6.x or even better 7.x if this bug is still open or feature is missing for these versions.