You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.
Zikula 1.3.10 and Polls 3.0.1
Select the option "Latest poll" in block options for this module. Select the option "Only one vote. No recurrence" for "How soon can a user vote for each poll?"
Register a vote from the block.
Refresh page.
The poll is showed again for register a new vote for your user.
The problem is in the method "display" of the file "Polls\Block\Poll.php". When it get variables from content block: $vars = BlockUtil::varsFromContent($blockinfo['content']);
Then use the variable "$vars['pollid']" for pollid, but this variable is "-1" (for the value for option "lastest poll").
So, when the module try to get if the user is allowed to vote // Check if the user is allowed to vote (meaning he has already voted in this poll) $allowedtovote = (bool)ModUtil::apiFunc('Polls', 'user', 'allowedtovote', array('pollid' => $vars['pollid']));
The module response: "yes, you can vote"
it's necessary change the logic for this case, where the pollid must to be retrieve with the function // Get the poll $item = ModUtil::apiFunc('Polls', 'user', 'get', array('pollid' => $vars['pollid']));
This function is prepare to get the last poll if $vars['pollid'] is "-1" value.
Thanks.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Zikula 1.3.10 and Polls 3.0.1
Select the option "Latest poll" in block options for this module. Select the option "Only one vote. No recurrence" for "How soon can a user vote for each poll?"
Register a vote from the block.
Refresh page.
The poll is showed again for register a new vote for your user.
The problem is in the method "display" of the file "Polls\Block\Poll.php". When it get variables from content block:
$vars = BlockUtil::varsFromContent($blockinfo['content']);
Then use the variable "$vars['pollid']" for pollid, but this variable is "-1" (for the value for option "lastest poll").
So, when the module try to get if the user is allowed to vote
// Check if the user is allowed to vote (meaning he has already voted in this poll) $allowedtovote = (bool)ModUtil::apiFunc('Polls', 'user', 'allowedtovote', array('pollid' => $vars['pollid']));
The module response: "yes, you can vote"
it's necessary change the logic for this case, where the pollid must to be retrieve with the function
// Get the poll $item = ModUtil::apiFunc('Polls', 'user', 'get', array('pollid' => $vars['pollid']));
This function is prepare to get the last poll if $vars['pollid'] is "-1" value.
Thanks.
The text was updated successfully, but these errors were encountered: