We are evaluating Commons 3 Q&A in order to create a new community portal.

Create a question, many answers with different users, and start to vote with different users.
- even if there are some votes, the first time a user see the question page with the answers, the vote counters are not displayed (only + and - buttons)
- then the user votes, some answers' votes are updated, some not
- the user have to refresh/reload the page to see the current votes
- if the vote count is 0 on an answer, sometime it is not displayed (only + and - buttons), sometime it is

One could expect from a production ready release to work well on a so expected feature. Is there a way to fix this ?

CommentFileSizeAuthor
#21 qapatch.jpg121.46 KBjaperry
#6 bug-duplicate-answer.png116.79 KBttoine

Comments

ezra-g’s picture

Title: Vote doesn't work » Issues with Q&A voting
Issue tags: +Commons 7.x-3.1 radar

Sorry to hear that you're having problems here.

Adding to the list of issues for the Commons team to triage before the 3.1 release.

ttoine’s picture

When the 3.1 will be released ?

Anonymous’s picture

When all issues in the "Commons 7.x-3.1 radar" are solved, I suppose.

ttoine’s picture

Addition: we noticed that in some cases, answers are duplicated when voting.

However, we can't understand why it is duplicated or not

ezra-g’s picture

Addition: we noticed that in some cases, answers are duplicated when voting.

Can you explain what you mean by duplication or post a screenshot?

When the 3.1 will be released ?

When all issues in the "Commons 7.x-3.1 radar" are solved, I suppose.

Correct. We're targeting end of this week.

ttoine’s picture

StatusFileSize
new116.79 KB

Screenshot attached

ezra-g’s picture

I did some initial triage here:

I was able to reproduce:

A) even if there are some votes, the first time a user see the question page with the answers, the vote counters are not displayed (only + and - buttons)
B) if the vote count is 0 on an answer, sometime it is not displayed

To reproduce B, vote, then delete from {votingapi_vote} and {votingapi_cache}.

For

- the user have to refresh/reload the page to see the current votes

Having the vote totals update in the background after the page has been loaded is not currently part of the design, but would make a nice feature request for a separate issue.

ttoine’s picture

Thanks a lot for your feedback. Do you think it can be fixed in 3.1 ?
Where can I do a feature request for the "vote totals update in the background after the page has been loaded"?

ttoine’s picture

Just to tell you we fixed the duplicate part of the bug. In the views, just select "disctinct" option.

japerry’s picture

Assigned: Unassigned » japerry

I too was able to reproduce, looking into this today. Ttoine, could you create a new issue for that feature request?

ezra-g’s picture

Where can I do a feature request for the "vote totals update in the background after the page has been loaded"?

You can add an issue at http://drupal.org/node/add/project-issue/commons.

japerry’s picture

Status: Active » Needs work

I've isolated the problem, it is due to our use of aggregating the votes in the widget, when the module is actually averaging them. Not quite sure of the fix, but it is certainly the commons rate widget, as all the other widgets work as they're supposed to.

will keep digging tomorrow ;-)

ttoine’s picture

japerry’s picture

Title: Issues with Q&A voting » Make sure Q/A 'vote info block' shows up at all times
Status: Needs work » Fixed

Renamed this issue to be specific about the vote info block, which is fixed per this commit below.

there are other Q/A issues regarding thumbs vs +/-, as well as indicating if you already voted. They will be taken care of in #1921502: Re-theme Up/down widget per updated designs

http://drupalcode.org/project/commons_q_a.git/commit/5dc670b

ezra-g’s picture

Title: Make sure Q/A 'vote info block' shows up at all times » Q/A vote total display should display in widget even when total is 0
Status: Fixed » Needs work

Re-opening. In my testing, the vote total update is not reflected after casting a vote, but is reflected when refreshing the page.

japerry’s picture

Status: Needs work » Active

crap. found some other new bugs. it appears to work when you're on specifically an answer node, but not when its rendered inside a question. The other bug here is that answer nodes should never appear on their own.

I also checked to see if it might be an issue with the 'points' vs 'percent' values in the resultset. It appears that when you use $results['up_percent'] instead of $results['rating'] it works. Perhaps there is an issue with the votingapi or rate module itself in how it caches these ratings.

ezra-g’s picture

it appears to work when you're on specifically an answer node, but not when its rendered inside a question.

If this refers to the vote totals, perhaps either the widget is not outputting markup that Rate module's JS is looking for, or perhaps that JS needs to be revised to target differently.

The other bug here is that answer nodes should never appear on their own.

This seems OK to tackle in a separate issue. #1946120: 'Answer added' activity stream message should link to the Answer node as displayed on the question covers a similar topic.

It appears that when you use $results['up_percent'] instead of $results['rating'] it works

Can you elaborate on what "works" about this and where you're making this change?

ezra-g’s picture

If this refers to the vote totals, perhaps either the widget is not outputting markup that Rate module's JS is looking for, or perhaps that JS needs to be revised to target differently.

#1676746: Addtional Classes and more unique ID might be relevant to adjusting selectors.

ezra-g’s picture

Title: Q/A vote total display should display in widget even when total is 0 » Vote sum not displayed until page is refreshed

Retitling.

ezra-g’s picture

japerry’s picture

StatusFileSize
new121.46 KB

After looking at #1947008: Inaccurate vote sum displayed after voting until page is refreshed I'm pretty sure its a problem with our widget defaulting to the users vote. I've change this, and made sure we're specifying the result score in the template.

qapatch

I've uploaded a fix here:
http://drupalcode.org/project/commons_q_a.git/commit/cedf589

You can test if this works by either re-installing, or going to
/admin/structure/rate/2/edit
and setting the Average rating button.

ezra-g’s picture

Status: Active » Needs review

I've uploaded a fix to the q/a branch.

This doesn't appear at http://drupal.org/project/commons_q_a/git-instructions.

Growiel’s picture

Hey guys,

Thanks, this is working just fine now.

I went ahead and updated the settings for the "Question" widget too, so that they both work the same way.

The only problem with this solution is that now you can't know if you voted "up" or "down" on this answer.

Maybe the widget should Highlight the thumbs according to what we voted.

Should I open a new feature request for this ?

japerry’s picture

Hi Growiel, we're refactoring some of the Q/A design in another issue #1921502: Re-theme Up/down widget per updated designs, which will involve adding some color to the thumbs/+/- up/down interface so people know which way they voted.

ttoine’s picture

japerry, it looks great. when will you release this new design ?

ezra-g’s picture

You can test if this works by either re-installing, or going to
/admin/structure/rate/2/edit
and setting the Average rating button.

Marking as "needs work" per the remaining upgrade path.

japerry’s picture

Assigned: japerry » ezra-g
ezra-g’s picture

Status: Needs review » Fixed

Added an upgrade path, tested, and committed. Thanks!

http://drupalcode.org/project/commons_q_a.git/commit/f2bf323

Automatically closed -- issue fixed for 2 weeks with no activity.