Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Inspired by https://drupal.org/node/481640#comment-1761924 we have created a similar patch for Plus 1 (7.x-1.0-alpha1). This patch enables anonymous voting with jquery by switching from drupal_set_token()
and drupal_valid_token()
to custom tokens.
It might be worth to consider putting this feature in the module.
Comment | File | Size | Author |
---|---|---|---|
#10 | plus1_anonymous_token_check-2059379-10.patch | 3.96 KB | badrange |
plus1_anonymous_token_check.patch | 4.05 KB | ricovandevin |
Comments
Comment #1
ricovandevin CreditAttribution: ricovandevin commentedLet's review first. ;-)
Comment #2
No Sssweat CreditAttribution: No Sssweat commentedworked perfectly for me, thanks for the patch :-)
Comment #3
iwant2fly CreditAttribution: iwant2fly commentedWorked for me as well. Thanks.
Comment #4
iwant2fly CreditAttribution: iwant2fly commentedWell it works, and it looks like it is saved, but if an anonymous visitor leaves the page after voting and comes back they can not see their vote.
Comment #5
willeifler CreditAttribution: willeifler commentedWorked beautifully. Thanks so much.
Comment #6
rogical CreditAttribution: rogical commentedricovandevin , can you re-roll the patch for the dev branch?
Comment #7
rogical CreditAttribution: rogical commentedComment #8
ricovandevin CreditAttribution: ricovandevin commentedHi rogical,
I'll try to reroll the patch asap.
Comment #9
badrange CreditAttribution: badrange commentedAttached is a re-rolled patch against 7.x-1.x checked out today. Haven't tested it thoroughly, but it seems to work.
Comment #10
badrange CreditAttribution: badrange commentedThe patch didn't work, one call to drupal_valid_token was still left in the module.
I also changed the token check to use === instead of == for possibly better security.
So we have this: