MyBB Community Forums

Full Version: This poll is closed?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I think there's a bug in the poll-system.
I made a poll, only members are allowed to vote on this poll. Everything works fine.
But, if a guest (someone who's not logged in) opens the poll, it say's 'This poll is closed' in the blue bar on top. But is isn't closed at all, it's just not available for not-logged-in persons (guests). After they logged in, the message 'This poll is closed' is disappeared and they can vote.

Why the message 'This poll is closed' appears if guests open the poll page? Should'nt there be a message like 'This poll is only for logged-in members'?

Hope somebody can help me with this issue.......
Because it's closed for guests and opened for members...
(2018-01-07, 02:12 PM)Ikerepc Wrote: [ -> ]Because it's closed for guests and opened for members...

Yes, but should'nt it say something like 'The poll is closed for guests, please log in for entering the poll'?
That's much clearer imo.......
Try showthread.lang.php > poll_closed

Change the wording there.
(2018-01-08, 03:04 PM)sarisisop Wrote: [ -> ]Try showthread.lang.php > poll_closed

Change the wording there.

Yes, I did that allready, but then this new text appears also if the poll is really closed........
I have to agree with OP here. Looking at the code in showthread.php, the following section of code relies on $alreadyvoted (which is irrelevant in this situation) and $showresults, which is set in a mass user-cannot-vote conditional.

		if(isset($alreadyvoted) || isset($showresults))
		{
			if($alreadyvoted)
			{
				$pollstatus = $lang->already_voted;

				if($mybb->usergroup['canundovotes'] == 1)
				{
					eval("\$pollstatus .= \"".$templates->get("showthread_poll_undovote")."\";");
				}
			}
			else
			{
				$pollstatus = $lang->poll_closed;

$showresults is set for all of these conditions:

		// If the poll or the thread is closed or if the poll is expired, show the results.
		if($poll['closed'] == 1 || $thread['closed'] == 1 || ($expiretime < $now && $poll['timeout'] > 0) || $forumpermissions['canvotepolls'] != 1)
		{
			$showresults = 1;
		}

If the rest agree, I can create a PR to add an extra conditional and variable and in that way, in the first section of code we can have an alternate condition that displays a "no permissions" message.
I agree too, go for it!
^ I agree. I'm hoping to see more useful error pages too in the future from MyBB. IMO they're not specific enough at all and sometimes even useless.
In my opinion, this is one of MyBB's weaknesses - it's poor language choices.

This is especially apparent in the AdminCP, where you can find yourself wracking your brains while reading so many settings and wondering "So is that a yes-yes or a yes-no?"
(2018-01-08, 03:49 PM)Wildcard Wrote: [ -> ]If the rest agree, I can create a PR to add an extra conditional and variable and in that way, in the first section of code we can have an alternate condition that displays a "no permissions" message.

Sounds like a good solution.
Pages: 1 2