ricky.middaugh:

"Voting completion page" is a way to bring the voter out of the election itself - when a user has finished voting and / or abstaining on every post, a button appears that brings users to a URL configured by election after a confirmation. We used this to bring voters to a "Thank you" page with an exit survey.

This was split from issue #1994958: Add a serialized 'settings' column to the {election} table so that elections can have arbitrary settings. by ricky.middaugh.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pjcdawkins’s picture

+  // VALIDATE COMPLETION REDIRECTION URL...
+  if (!valid_url($form_state['values']['settings_voting_completion_redirect'], TRUE)) {
+    form_set_error('settings_voting_completion_redirect', t('The redirection path must be a valid URL.'));
+  }

This causes the form to fail validation even if the path is left blank.

pjcdawkins’s picture

+        '#display' => 'embed_plurality',

This Views display does not exist.

pjcdawkins’s picture

I might have guessed that "Finish voting" meant:

  • I can't come back and vote again after finishing
  • I have to click "Finish voting" before my votes will count

Neither of which are true. So I think this feature could become a source of confusion for voters.

ricky.middaugh’s picture

The first two issues mentioned above are fixed in the first patch (election-fix-redirect-1995640-5-do-not-test.patch). The redirection URL should no longer be required (Blank is a valid option), and the views display that was being used has been removed.

The second patch updates the voting button that appears - instead of saying "Finish voting" it now defaults to "I'm done" and can be updated per election by anyone with permission to modify elections.

The patch in the description must be run first for these patches to work. Sending this one to review - let me know what your thoughts are on the new button default.

Status: Needs review » Needs work

The last submitted patch, election_completion_page.patch, failed testing.

Liam Morland’s picture

Patch in parent ticket is committed, so it no longer has to be applied before the patches in this ticket.

Liam Morland’s picture

Status: Needs work » Needs review
FileSize
9.74 KB

This patch is a re-roll which combines the three patches in this issue.

OpsTao’s picture

I have tried running the #7 patch from Mac Terminal but got this partial-success result:

patching file election.css
patching file election.forms.inc
patching file election.module
Hunk #1 succeeded at 459 (offset -7 lines).
Hunk #2 succeeded at 473 (offset -7 lines).
Hunk #3 succeeded at 675 (offset -7 lines).
can't find file to patch at input line 173
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/election_post/election_post.module b/election_post/election_post.module
|index 6e1ba26..76ff8b6 100644
|--- a/election_post/election_post.module
|+++ b/election_post/election_post.module
--------------------------

Will result be insufficient? Suggest a more reliable way to patch?

pjcdawkins’s picture

@OpsTao
Patches are designed to apply against the latest -dev version of the module. Perhaps you have a slightly older version?

Instructions on applying patches:
https://www.drupal.org/patch/apply

OpsTao’s picture

It was the latest stable release (7.x-1.0-beta25) I was patching. I can try it on 7.x-1.x-dev. But since the functionality provided by the patch is something we really need on the production site, perhaps it is unwise to use it at all, since it will depend on using the dev version.

pjcdawkins’s picture

Status: Needs review » Needs work

@OpsTao It actually looks as if the patch won't cover your needs yet.

@Liam Morland

+++ b/election_post/election_post.module
@@ -663,6 +672,24 @@ function _election_post_is_open(stdClass $post, $status_prefix) {
+function _election_posts_check_account_previously_voted($posts, $user = NULL) {
+  foreach ($posts as $post) {
+    if (!election_vote_check_account_previously_voted($post, $user)) {
+      return FALSE;
+    }
+  }
+  return TRUE;
+}

This needs to check voting access. If the user does not have access to that post, it should skip the check (at the moment it will return FALSE).

Liam Morland’s picture

Do you mean calling election_vote_access() in the if statement where election_vote_check_account_previously_voted() is called?

Liam Morland’s picture

If you would like this included in 7.x-1.0, please provide an updated patch in the next week or so.