This patch adds the votingapi.usermerge.inc, which adds User Merge support to VotingAPI, allowing votes to be changed to be owned by the user_to_keep.

It has received pretty minimal testing, so it should be reviewed and tried out a bit. In particular, when you delete votes (select one user's votes instead of merging them, so the other user's votes are deleted) it should call the right votingapi_recalculate_results() function to recalculate the voting api totals in the votingapi_cache table. But all the testing I've done is on the merge path.

Comments

antiorario’s picture

Title: Integration with VotingAPI » Add User Merge support to Voting API
Project: User Merge » Voting API
Issue summary: View changes

The list of supported modules is becoming larger and larger, and I'd like to limit the size of the User Merge code. I'm moving this to the Voting API issue queue. The patch will need to be changed to the file is added to the main Voting API directory.

quotesbro’s picture

StatusFileSize
new4.92 KB

I updated the patch so it can be applied to votingapi now.
Also I fixed not working part of the votingapi_usermerge_merge_accounts function (deletion of user votes in the `else` branch).
And also I rewrote the code responsible for votes merge to avoid duplicate votes after the merge.
A review would be very welcome.

tr’s picture

Status: Needs review » Closed (won't fix)

If you're talking about https://www.drupal.org/project/usermerge that project only has a few hundred users, hasn't had a release in over 5 years and does not work in D8 and does not appear to be supported any longer.

While it's good to have this patch available for the small number of people who might need it, I don't think it's worth the effort to try to get this into Voting API just for D7 - D7 is nearing its end-of-life anyway. Patch doesn't apply and needs to be re-rolled in any case.

@quotesBro is the only person in the Voting API community that has expressed any interest in this feature at all in the last 7 years, and that's just not enough interest to justify spending time adding support for an unsupported and obsolete module.