localgovdrupal / localgov_elections

This module provides submodules, content types, views and configuration that allow the reporting of election results for the LocalGov Drupal distribution.
GNU General Public License v2.0
1 stars 0 forks source link

2nd place shown as winner #39

Closed willguv closed 2 months ago

willguv commented 2 months ago

I've set up two constituencies from 2019 with actual results. In both cases, some pages are showing 2nd place as the winner

Here's the results I entered - a Conservative victory https://members.parliament.uk/constituency/3322/election/397

Everything is on my Github, I can give you access

https://8080-localgovdru-localgovpro-yrafudpucjp.ws-eu114.gitpod.io/election/bexhill-and-battle-ge-2019/bexhill-and-battle

1 - This page shows no Tory vote and Labour Hold

(How do you get to this page via the left hand navigation?)

Screenshot 2024-06-22 at 14 12 37

2 - The summary page shows a Tory victory, no other votes, and all of the parties (even though there are candidates in only 4 of them)

Screenshot 2024-06-22 at 14 20 05

3 - The vote share page is missing the victor

Screenshot 2024-06-22 at 14 22 15

The results timeline page seems to be OK

snpower commented 2 months ago

I set up a brand new clean install using ^1.0@beta of localgov_elections and configured it with the same election candidates/results and I can't reproduce it.

willguv commented 2 months ago

I tried a fresh install too and seeing the same errors

There are colors on the chart now, but they're incorrect

eg Caroline Bayliss is Labour, so should be red

Will write down steps on Monday, and maybe let's join a call

Image

dedavidson commented 2 months ago

@willguv it looks like you have a ghost candidate given the empty top row in the graph.

dedavidson commented 2 months ago

@willguv did you manage to document your steps? I can try and recreate.

willguv commented 2 months ago

@dedavidson here's a database dump

backup-2024-06-25T09-13-54.mysql.gz

And videos...

https://www.loom.com/share/da319e4effd74f5e8b65c5fe9f67c800 https://www.loom.com/share/f9755e46292c4822a2e36dabdb847c77

dedavidson commented 2 months ago

@willguv not had a chance to test yet but I wonder if the issue is because you hadn't published either of the election or the areas vote.

The summary is correct because the Conservatives have won 1 seat and none of the other candidates have won anything.

dedavidson commented 2 months ago

@willguv can you upload your composer.json so I can use your db backup please

finnlewis commented 2 months ago

Could it be a caching issue with js and charts js ?

I've just mocked up the same data from https://members.parliament.uk/constituency/3322/election/397

On first save, I saw just one bar, the conservative bar.

On cache clear, I see all 4:

Image

finnlewis commented 2 months ago

Possibly related, but just deleting all my candidates to try agagin.

With no candidates (and no votes) I see a summary of 37590 votes in the summary table.

Caching?

Image

finnlewis commented 2 months ago

Add the candidates back in (in reverse order this time) and save:

Image

finnlewis commented 2 months ago

Ahhh... I'm looking at different summaries, right?

willguv commented 2 months ago

@finnlewis @dedavidson

I did as @snpower suggested and installed the demo content - all results are appearing correctly. Will try it again tomorrow without the demo content

Three remaining issues:

1 - The summary page is only showing the winning party and the horizontal scale is showing 0.1 gradations up to 1.0. Is it designed to do this?

Image

2 - The ward page refuses to show colors, despite repeated cache clears

Image

3 - A duplicate ward page appeared mid way through creating these pages, and haven't been able to duplicate. If it reoccurs I'll write a new issue for it

dedavidson commented 2 months ago

@willguv 1. is not an issue. If you have just one constituency then there will only be one result to show. The summary is an overview of all the results.

The scale is auto scale so as the number of results increase this will change. If someone with chartjs knowledge knows how to make it only show integers then that would be better.

markconroy commented 2 months ago

Follow up for showing integers instead of decimals https://github.com/localgovdrupal/localgov_elections/issues/53

willguv commented 2 months ago

Good news - have run through this again with Beta 2 and no demo content. It's all working fine