Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
744 views
in Q2A Core by

On my forum I'm trying to configure the following voting permissions:

  • Upvote questions: all registered users
  • Upvote answers: registered users with at least 25 points
  • Downvote questions and answers: registered users with at least 50 points

However, the settings don't seem to work the way I expected. Instead, the downvote permissions apply to upvotes too. Is that intentional? (looks like a bug to me)

And how/where would I fix that?

Q2A version: 1.8.4

1 Answer

+2 votes
by
selected by
 
Best answer

I'm not able to reproduce this. I set these options:

  • Voting on questions: registered users
  • Voting on answers: registered users & 25 points
  • Voting posts down: registered users & 50 points

And got these results:

  • A user with 10 points could upvote questions but couldn't upvote answers or downvote anything.
  • A user with 40 points could upvote question & answers but couldn't downvote anything.
  • A user with 60 points could upvote & downvote both questions & answers.

Is that how you expect it to work?


Update: looks like it's a problem with the theme. It's an old theme of mine that I haven't updated for years but to fix it you need to find the vote_button_up function in qa-theme.php, and replace this

case 'enabled':

with this

case 'enabled':
case 'up_only':

I've updated the repo, diff here: https://github.com/svivian/q2a-themes/commit/897e8b3005ae2ff298c1be8db991111a6e043b0a

by
Yes, that is what I expected. But it doesn't work on my site.
I did some further testing in the meantime, and when I change the theme to SnowFlat the voting buttons start to work (well, sort of, since the points don't seem to get applied, but at least the vote counter goes up). When I change the theme back to my own I'm back to "cannot upvote unless downvote permission applies as well". I can unvote a vote I cast while the other theme was active, though (but not re-vote afterwards).
My theme is based on your Clean Base theme and essentially just changes the stylesheet. Could that be the problem? Does Q2A 1.8.4 need changes to the PHP code in the theme?
by
Updated my answer, it's a problem with the theme.
by
Thanks. Would you believe that I literally discovered that myself 5 minutes ago? Oh, well.
...