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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ricovandevin’s picture

Status: Patch (to be ported) » Needs review

Let's review first. ;-)

No Sssweat’s picture

Status: Needs review » Reviewed & tested by the community

worked perfectly for me, thanks for the patch :-)

iwant2fly’s picture

Worked for me as well. Thanks.

iwant2fly’s picture

Well 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.

willeifler’s picture

Worked beautifully. Thanks so much.

rogical’s picture

Issue summary: View changes

ricovandevin , can you re-roll the patch for the dev branch?

rogical’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Status: Reviewed & tested by the community » Needs work
ricovandevin’s picture

Hi rogical,

I'll try to reroll the patch asap.

badrange’s picture

Status: Needs work » Needs review
FileSize
3.59 KB

Attached is a re-rolled patch against 7.x-1.x checked out today. Haven't tested it thoroughly, but it seems to work.

badrange’s picture

FileSize
3.96 KB

The 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:

function plus1_check_token($token, $value) {
  return plus1_get_token($value) === $token;
}