SMF Development > Bug Reports
View results button under poll with results only after voting
phantomm:
If in poll settings you mark option "Only show the results after someone has voted." under this poll regular user can see button "View results" even if they did not voted yet.
Tested on clean SMF 2.0.2 UTF8
Didn't see this reporter before ::)
emanuele:
But if they press it they don't see anything, right?
phantomm:
Yes, page is reloaded and they can't see results, but anyway button shouldn't be displayed
emanuele:
Yes, of course. It was just to be sure. ;)
I think this should fix it:
--- Code: (find) --- $context['show_view_results_button'] = $context['allow_vote'] && (!$context['allow_poll_view'] || !$context['poll']['show_results'] || !$context['poll']['has_voted']);
--- End code ---
--- Code: (replace with) --- $context['show_view_results_button'] = $context['allow_vote'] && ($context['allow_poll_view'] || $context['poll']['has_voted']) && !$context['poll']['show_results'];
--- End code ---
Not tested in many conditions, but should make more sense...
phantomm:
yes this fixed it :)
Navigation
[0] Message Index
[#] Next page
Go to full version