I am jumping the gun a little here.
I have created a patch for VotingAPI to save the previous vote value to the database. See #1880462: Keep track of the previous vote in the database.
I want to be able to use this value in the rules. I will attach a patch and a screen-shot.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | voting_rules2 .tar_.gz | 2.58 KB | istryker |
| #3 | value.png | 33.08 KB | mermemladeK |
| #1 | previous-vote-rule-1882086-1.patch | 576 bytes | istryker |
| #1 | 1882086-screenshot-example.png | 49.74 KB | istryker |
Comments
Comment #1
istryker commentedAttached is the patch and screenshot
Comment #2
istryker commented@melissavdh created the identical patch over in VotingAPI #1880462: Keep track of the previous vote in the database comment #4. Changing this status to RTBC
Comment #3
mermemladeK commentedHi iStryker,
I applied both patches but I do not get
vote:previous-valueas you can see in the png. Am I doing something wrong? Yes I ran the update script.Comment #4
istryker commentedOk I just double check this on a fresh install and it worked.
Drupal 7.19
Votingapi Git 7.x-2.x
Voting_rules Git 7.x-1.x
Rules 7.x-2.2
patch http://drupal.org/files/previous-vote-rule-1882086-1.patch from Comment #1
patch http://drupal.org/files/add_previous_vote-1880462-3.patch from #1880462: Keep track of the previous vote in the database
If this doesn't work, then I would rebuild Rules caching
http://-yoursite.com-/admin/config/workflow/rules/settings/advanced
Comment #5
mermemladeK commentedI rebuilt the Rules caching and yet nothing.
I went through the patched files and the code is there...
I'm using:
Voting API 7.x-2.10,
Voting Rules 7.x-1.0-alpha1
Rules 7.x-2.2.
I really wonder what's wrong.
Comment #6
istryker commentedOk this might be the weirdest thing, I had problems testing it on Staging. Staging had APC caching on. I either waited 1 day, or turned it off, and everything work.
APC caches PHP files. Any change made to the file will not be seen until the cache is cleared. This is at the PHP layer, not the Drupal layer.
I also confirm this by copying voting_rules module to voting_rules2, with identical files (except all the functions were voting_rules2_... instead of voting_rules_... as well as the name of all the files) with the patch already in it and it worked right away.
Comment #7
mermemladeK commentedHi iStryker,
My host is GreenGeeks and I don't think the problem is about APC caching.
Would you min attaching your patched files so that I can compare them with mines and see if there's anything different please?
Thank you
Comment #8
istryker commentedvoting_rules2 tar file attached with previous value
Comment #9
mermemladeK commentedHi iStryker,
It's working! Sorry for the inconveniences, I think it was my noobish skills than anything else. I used a clean downlaod for voting-rules and patched the files manually (I learnt that in the process), and now it works!
Comment #10
blogook commentedWorks great for me too! I am giving my users points for voting, now that I can check against the previous value I also can check if the user is not voting twice :)
I am wondering though, if there will be an update for votingapi, what will happen with the patch?
thanks in advance