Upgrade voting_actions to 5.x
kaerast - January 19, 2007 - 17:52
| Project: | Voting Actions |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
voting_actions needs updating to work with Drupal 5.x

#1
+1 on this issue. I use it with the vote up/down module. I would greatly appreciate it being upgraded to drupal 5.0.
#2
I agree this is a great module and would be really useful in 5.0.. unfortunately I can,t do it as I don't know how to code... but ... hum +1 !!
#3
A vote from me too! Now if we could all code, we would get down with and port it. So who can code?
#4
Hello, I have made all the changes listed in http://drupal.org/node/64279#info for converting this module from 4.7 to 5.0 version. I didn't see any problem with limited testing I did with drupal 5.0. I don't know how to submit this into drupal CVS. However if you want to try this and use this as a base for 5.0 version of voting_actions module, plese see the file attached with this post. It is a zip file ( though named as .zip.patch to bypass some upload problems). Expand it and test it with drupal 5.0. It is working well for me.
#5
This patch is unnecessary, the vote UP/DOWN 5.x version includes vote_up_down_actions.inc
#6
Are you sure vot up/down actions is same(rewrite) as voting actions module?
#7
I'm sorry, I meant the votingAPI for Drupal 5 has voting actions included.
#8
Actually, scratch everything I said. While the "shell of voting actions module" is included in voting API, there are no actions that can be added. After deeper inspection of my sanbox, after going to administer -> voting API -> voting actions, User are presented with
Go ahead and submit your patch for review.
I should have dug deeper before I commented, I had enabled the module voting_actions without realizing it didn't allow you to create them, however, the necessary vote up/down actions are included with the vote up/down module. So I was not losing any functionality from the 4.7 version.
#9
Installed your port of voting_actions (least I could do!)
noticed in the .info file you did not change the version I have in my installation
#10
Seems to be working perfectly fine in Drupal 5.1. Other then the versioning in the .info file that I previously mentioned, I think this is ready to be committed for review by Eaton.
I'll let you mark it though : )
Again sorry for the confusion I caused.
#11
Further testing:
I can't seem to get nodes to be promoted to the front page, using this port of voting_actions.
value type: Points
tag: vote
function: sum
comparison: is greater than
value: 1
action: Promote node to front page.
After supplying two votes, the node (audio in this case) was not promoted to front page.
#12
Even I misunderstood voting api actions as rewrite of voting actions. It is just a shell as you mentioned.
I will test and see if voting action function really works.
#13
The patch submitted by senthiln does not work because of some changes in votingapi module. The author of votingapi has removed the following lines from votingapi.module file
define('VOTINGAPI_VALUE_TYPE_PERCENT', 'percent');define('VOTINGAPI_VALUE_TYPE_TOKEN', 'points');
define('VOTINGAPI_VALUE_TYPE_KEY', 'option');
An fast solution would be to add the above code at the beginning of voting_actions.module (the one submitted by senthiln, of course)
#14
I've applied the patch and the recommended 3 lines of code to the voting_actions.module.
Voting works, but the node still will not promote to the home page.
The issue seems to be that when you try to save an action using "admin/settings/voting_actions", it just resets to the default filter criteria.
#15
I can't seem to get this to work either, does anyone have a solution for it? It would be greatly appreciated, as it's just what I need for my current website.
#16
Hey, folks.
First off -- I apologize for the delays that voting_actions has experienced. I realize it's a critical module for a number of cool sites and I don't want it to slip through the cracks. As I mentioned in the past, the 'votingapi_actions' module that's built into version 5 of VotingAPI is the direction that I want to take things in, but I haven't yet had a chance to complete the UI work on that code. Last night I picked it up and have started hacking at it. I hope to have a beta-level version of the new UI (in other words, something usable and testable) up within the next week or so.
#17
This is a very important module. Thank you very much, Eaton.
#18
Hi Eaton,
Please post here when you need people to test the voting actions in 5.0. I'm ready and willing to test as soon as possible.
Thanks, patchak
#19
Just curious to see what the status with the upgrade to 5.0 was? I'm also ready and willing to test Eaton's module.
#20
Hi all,
I think we are a lot of people here waiting for this upgrade to happen... and of course eaton is the man to do the job since all this voting API and stuff are his code... I suspect that Eaton might be busy on other projects and might not *need* voting actions to work for his current projects.. that might create still more waiting time for all of us who need that module to work on 5.0 ASAP (for new projects and porting those 4.7 sites to 5.0). Maybe we could get a commun bounty and get Eaton to work on this ASAP by paying him to do so??
I fully understand Eaton maybe has other prioritites and of course Drupal is based on the scratch your own itch concept, so maybe we could all get together and 'scratch our own itches' by providing a monetary compensation for Eaton's time??
@Eaton: maybe you are actually working on this and have a something ready for release, but if it's not the case, would you be interested in working on this module in exchange of some bounty?? How much time would you need us to pay you to get a new voting actions module ready by mid-april??
Of course this is not intended to critisize you, and I hope you,re not offended but judging by the amount of digg-like sites out there that use voting actions, it would be nice if we could get something to chew on soon!! This is not to put pressure on you, but simply to try and create an opportunity!
What do you all think about this?
thanks,
Patchak
#21
In response to Patchak's comments, I'd like to chime in and add that I'd be willing to ante up or chip in to a bounty if that will help any. I might even be willing to sponsor the cost of updating this module to 5.0 if the cost isn't out of my range. If this interests you Eaton, please feel free to contact me.
Of course, if this is already being worked on, then even better. = )
#22
I've only started looking at the code so it's too early to propose a patch. what i did to get it to work is change the following function to look like this
function voting_actions_check_result_against_condition($result, $condition) {$value_types = array(VOTINGAPI_VALUE_TYPE_PERCENT => 'Percentage Scale', VOTINGAPI_VALUE_TYPE_TOKEN => 'Points', VOTINGAPI_VALUE_TYPE_KEY => 'Custom Options');
if (strtolower($value_types[$condition->value_type]) != strtolower($result->value_type)) {
return VOTING_ACTIONS_NO_MATCH;
}
if (strtolower($condition->function) != strtolower($result->function)) {
return VOTING_ACTIONS_NO_MATCH;
}
...
The issue is that the cache variable which is passed to voting_actions_votingapi_results isn't initialized properly. the value type for items in the cache are set to 'Points','Percentage Scale', and 'Custom Options'. When these values are compared against the constants, they always fail. The solution to fix the initialization code so that the value_type for items in the cache are set properly before the call to voting_actions_votingapi_results(). this is a small fix to get you going until such solution is implemented.
#23
Hey, folks.
After quite a bit of development, Voting Actions 2.0 (for Drupal 5) is checked into CVS. The dev-snapshot for it should be available on the voting actions project page shortly, as soon as Drupal rolls up the tarball for it (http://drupal.org/node/137197). If you're super-eager, you can grab the current version from CVS in the DRUPAL-5 branch. The upgrade path from the 4.7 version of VotingAPI is rough, and needs additional testing, so I'd HIGHLY recommend installing and tinkering with this new version on a sandboxed site until the official 2.0 version is released.
Why did this take so long? Frankly, the 4.7 version of Voting Actions was a relatively crude hack that was put together for a client's very specific needs. It had quite a few outstanding bugs and serious limitations related to the underlying architecture. It's been rewritten from scratch in this version, and offers a couple major benefits:
Again -- there are still rough edges and there will likely be additional bugs found, but the new code base is MUCH more robust, much more flexible, etc.
I've attached a screenshot of the new configuration page to give a taste, for those who haven't yet been able to mess around with it.
#24
To make things easier to keep track of, I've rolled an official Voting Actions 2.0b1 release. It can be downloaded at http://drupal.org/node/137931 -- please, anyone upgrading from a previous version, note the caveats about the upgrade path. That part NEEDS more testing and should not be done on the live version of your site unless you're willing to recreate your action sets if something goes wrong. :-)