Hello,

It will be cool if we could integrate VotingApi in Activity module.

I'm not a developer, so I can't help a lot... :(

Activity module provide an extensible API to allow other modules to integrate by using Activity hooks.

Here the Activity issue about integrate VotingApi to Activity #455906: Integration with Votingapi.

I attach DEVELOPER.txt file from Activity module.

I hope someone could help :)

Comments

junro’s picture

Title: Make VotingApi work with Activity » Integrate VotingApi to Activity module
junro’s picture

Title: Integrate VotingApi to Activity module » Integrate VotingApi with Activity module
Scott Reynolds’s picture

Status: Active » Needs review

Here is a patch for it. So it provides the following features
1.) Record voting api activity to streams for node and comment content_types (users are hard, will come back to why later).
2.) After User A votes on the node 14, all Activity around that node 14 can be placed in that User's A Activity stream via Activity Access Votingapi: User voted on node.
3.) After User A votes on comment 34, all Activity around that comment can be placed in User's A stream via Activity Access Votingapi: User voted on same Comment
4.) After User A votes on comment 65 on node 17, all Activity around node 17 can be placed in User's A stream via Activity Access Votingapi: User voted on node.

User voting activity is hard, because of Token. Using token, you can only have one 'user' object for the entire string. So in this case, the 'user' object is the user who does the activity. See votingapi_activity_objects_alter(). So it becomes a little complicated.

Scott Reynolds’s picture

StatusFileSize
new4.97 KB

forgot the patch.

Scott Reynolds’s picture

Issue tags: +activity2-integration

Added the tag so i can find this again

Scott Reynolds’s picture

StatusFileSize
new4.67 KB

typo in the table name (comment != comments)

Scott Reynolds’s picture

StatusFileSize
new5.09 KB

Reroll, as the hook_activity_grants() arguments changed.

Scott Reynolds’s picture

StatusFileSize
new4.79 KB

Forgot the --no-prefix and --relative arguments to git diff for this. Here is the reroll

jcmarco’s picture

Tested and working fine
Nice feature for Voting API
Thank you.

gdd’s picture

Status: Needs review » Reviewed & tested by the community

Trying this out for a new site we're building and it is working very well. I think this is well worthy of inclusion.

gausarts’s picture

Yo, great work for community site. Thanks a lot

mcpuddin’s picture

Works well for me. What can we do to get this integrated in voting api?

junro’s picture

Hello,

Just at least try this patch but I can't really have what I would like:

How to display the value of the user vote with the activity message?

For exemple:

[user] has given [value] to [title].

Right now: I can only have: [user] has vote [title] and the activiy message is displayed only on node author profile not in the user profil who give the vote.

Fidelix’s picture

This would be ultimately awesome.

A big SUBSCRIBE right here is a must.

Scott Reynolds’s picture

Please don't subscribe without trying it out. Its really easy to apply patches: http://drupal.org/patch/apply

Votingapi issues take a long time to get in.

Fidelix’s picture

Sorry Scott, i was refering to this:

Just at least try this patch but I can't really have what I would like:
How to display the value of the user vote with the activity message?
For exemple:
[user] has given [value] to [title].
Right now: I can only have: [user] has vote [title] and the activiy message is displayed only on node author profile not in the user profil who give the vote.

I subscribed because that is what i need for my project, and for what i understand this is not possible yet.
If it is, please tell me. I will CERTAINLY try it out and give all the feedback i can.

----
...thinking about it, i believe this is possible, and is not very hard to accomplish, but some php/mysql knowledge would be needed.
I'll see what i can do, i will try to do this next week.

Scott Reynolds’s picture

just need to write an hook_token_info and hook_token_value for those things.

Its just token integration not activity integration that is missing from what you would need.

Fidelix’s picture

Oh, OK.
Do you have any plans to write this functionality Scott?

Regards.

bflora’s picture

Anyone available to walk me through setting this up? I don't see how it's possible right now. When someone votes for a story, I want it to generate an activity item.

bflora’s picture

Hi, Scott,

I've applied the patch from #8. I can now create activity publishing templates for when someone votes for a story.

However, they're not showing up in my activity view. Do I need to add a specific relationship or something to my view to get them to appear in the feed? Thanks.

jtse’s picture

Tested the patch. Works. Great work Scott! The issue I have is that I can't create separate activity feeds for comments and votes on the same node. So let's say I have two activity templates defined:

1. When User votes on Article, then activity feed should say: User A voted on Article 1.
2. When User comments on Article, then activity feed should say: User A commented on Article 1.

When the user votes, it appears as a comment (i.e., only the second template gets displayed).

Ideas?

Jim

[UPDATE] -- Never mind, it seems to be working now.

liliplanet’s picture

subscribe thx!

eL’s picture

nice, is this in DEV version now?

mastermtg’s picture

Ya is this in the developer version now?

torotil’s picture

Version: 6.x-2.3 » 7.x-2.x-dev
Status: Reviewed & tested by the community » Needs work

Sorry for picking this up after such a long time. I took over this module last autumn. Do you still use this integration? Does it still work with the current 7.x-2.x version?

torotil’s picture

Status: Needs work » Patch (to be ported)
tr’s picture

Issue summary: View changes
Status: Patch (to be ported) » Closed (won't fix)

The activity module development seems to have stalled at D6. The last commit to the 7.x branch was over 7 years ago, and there has never been a D7 release of this module, not even a -dev release.

Also, there doesn't seem to be any community support for this integration anymore.

I think the realistic status for this issue is "Won't fix"

If you still want this, the first step would be to get the Activity module up and running again in D7 or D8, then post a new patch here in the Voting API queue for the integration. I won't consider a new patch until Activity is being maintained and has a current working release, because that would just be a waste of time at this point.