Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Pollid is not found for the block of Polls #6

Open
KratorD opened this issue Mar 14, 2016 · 0 comments
Open

Pollid is not found for the block of Polls #6

KratorD opened this issue Mar 14, 2016 · 0 comments

Comments

@KratorD
Copy link

KratorD commented Mar 14, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant