i've been testing a ranking decision, with 3-4 candidates and no restriction on how many/few the voter chooses. when the ballot closes, the results show the correct number of voters and the correct result. however, on the 'votes' tab, when looking at individual votes, there are some irregularities:
- irregular number of votes listed per page of results. usually 6, 7, or 8, occasionally 20.
- where the number of votes displayed is less that 20, the last voter listed is shown both on that page, at the bottom of the list, and on the next page of results, at the top of the list. their votes are split between the two pages.
example:
voter_x cast their ballot for green>blue>red>purple
they are listed at the bottom of the first page of votes like this:
"voter_x green>blue"
they are listed at the top of the second page of votes like this:
"voter_x red>purple"
this makes it look like both red and green were top-ranked.
the results (in the results tab) are still correct--it's just the display. but as my org has a mechanism for examining the votes to verify contested results, they must display correctly.
any help would be greatly appreciated!
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | paging.patch | 3.31 KB | anarcat |
Comments
Comment #1
jinjur commentedi haven't made any progress on this yet - can someone confirm for me that the results display is governed by this module? or should i be submitting this at voting_api?
thanks for any help you might be able to give.
Comment #2
anarcat commentedSo I confirm this display is totally decisions' responsability. Do not go open an issue in voting_api just yet. :)
Comment #3
anarcat commentedSo let's see if I can reproduce this here.
* i created a ranking / IVR decision: http://decisions.test.koumbit.net/node/5
* i created a bunch of votes for it:
And indeed, the display is screwed up. I'll take a closer look at this.
Comment #4
anarcat commentedBesides, there should be 20 votes per page, it's really odd that the number varies...
Comment #5
anarcat commentedSo it's pretty tricky. The display is driven by a pager_query() function, but the rows returned by that function are votes, not users, and the table is displayed by user, so this obviously breaks because it counts the votes instead of the number of rows.
I'm not sure how to implement paging. I still upload the work I've done so far (which I have ditched, because it breaks simple voting) and will restart from scratch. Not sure we'll be able to use the pager here...
Comment #6
anarcat commentedAlright, I figured it out. Turns out I was messing around with the pager too much, but the query actually works fine. It is however too MySQL specific, but it's pretty neat... I committed a fix in http://drupal.org/cvs?commit=253542
Comment #7
jinjur commentedthank you for looking at this, and fixing it! i've been pretty thrilled with the module, other than that weird behavior.