Skip to content
Snippets Groups Projects
Commit 06ff0436 authored by Tanmay Khedekar's avatar Tanmay Khedekar
Browse files

Fixed errors & dependencies.

parent fc739fb1
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,6 @@ dependencies:
- twig_tweak
- encrypt
- election:election_conditions
- election:election_fptp
- election:election_openstv
- csv_import_export:csv_import_export
- token:token
- views_autocomplete_filters:views_autocomplete_filters
......@@ -249,6 +249,7 @@ function election_check_phase_status_changed($entity) {
$phases = [];
foreach (Election::getPhases() as $phase_id => $phase) {
if ($entity->original->getPhaseStatus($phase_id) != $entity->getPhaseStatus($phase_id)) {
// Phases will always have unique key as we are using $phase_id as key.
$phases[$phase_id] = $phase;
}
......@@ -263,7 +264,7 @@ function election_check_phase_status_changed($entity) {
// }
// }
}
return array_unique($phases);
return $phases;
}
/**
......
......@@ -198,7 +198,7 @@ class ExportEligibleUsers extends BatchDownloadCSVForm {
if ($form_state->getValue('phase') == 'voting' && ($form_state->getValue('category') == 'already' || $form_state->getValue('category') == 'not_already')) {
$election = Election::load($form_state->get('election_id'));
$already = $election->getVoterUserIds();
$already = $election->getVoterIds();
if ($form_state->getValue('category') == 'already') {
return array_intersect($uids, $already);
}
......
......@@ -54,7 +54,7 @@ class VotersByPostType extends ElectionStatisticBase implements ElectionStatisti
// Number of voters who voted for this category overall
// Voters who voted for combinations
$post_voters = $post->getVoterUserIds();
$post_voters = $post->getVoterIds();
foreach ($post_voters as $uid) {
if (!isset($voter_values[$uid])) {
$voter_values[$uid] = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment