Cookie type does not work on my installation. Voting in a poll and then refreshing the page allows the user to vote again.
In advpoll_add_votes we have the following line;
setrawcookie($vote['type'] . $vote['nid'], 'vote', time() + (60 * $vote['duration']), '/', $cookie_domain);
The problem is that $vote['type'] is 'node' whereas in the test in advpoll_user_eligibility we have this if statement;
if ($data->mode === 'cookie' && isset($_COOKIE[$node->type . $node->nid])) {
And $node->type is 'advpoll'.
Heres my cookie;
'node53150' => string 'vote' (length=4)
And here's $node->type . $node->nid
string 'advpoll53150' (length=12)
Comments
Comment #1
cbComment #2
cbPatch attached.
I created a new key in $vote because I could see $vote['type'] being used elsewhere.
Comment #3
tripper54 commentedThanks for spotting. This is no doubt a hangover from a confusion between bundles and types when the D7 version of the module was first built.
I'll have a close look & test over the weekend.
Comment #4
tripper54 commentedCommitted, thanks.