Add a post setting to allow write-in candidates for elections. This would be something that would be implemented differently (or ignored) by each election type as needed.

Comments

ricky.middaugh’s picture

Assigned: ricky.middaugh » Unassigned
Status: Active » Needs review
StatusFileSize
new2.38 KB

Adding a patch for review. Because each election type would implement this differently (or not at all), the main purpose of this is to ensure that voting rules are correct if an election type implements it. For example, this will allow voting on a post that has no candidates if write-in candidates are enabled.

Status: Needs review » Needs work

The last submitted patch, election-add-write-in-candidates-1995704-1.patch, failed testing.

pjcdawkins’s picture

StatusFileSize
new1.76 KB

Have a look at the attached for a more exotic (and perhaps too wordy) approach.

[edit: apologies for the incorrect patch naming]

ricky.middaugh’s picture

I'm fine with the new patch. This would also allow other use cases to update it in the same way.

pjcdawkins’s picture

Status: Needs work » Needs review
StatusFileSize
new3.84 KB

OK here's a bigger patch, with a few more thoughts but the same general idea.

ricky.middaugh’s picture

Looks good! I like the change from using db_query() to the EntityFieldQuery as well.

pjcdawkins’s picture

Status: Needs review » Fixed

Committed, thanks!

pjcdawkins’s picture

Title: Add Write-in Candidates to be implemented by election type » Allow modules to alter election_candidate_post_has_enough()

Changed title to show that this diverged from the "write-in" feature, which should be left to other issues / election type modules.

Status: Fixed » Closed (fixed)

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