josephlacey / com.jlacey.electoral

GNU Affero General Public License v3.0
6 stars 12 forks source link

Update election districts if address is changed #8

Open andyburnsco opened 5 years ago

andyburnsco commented 5 years ago

Joting down this feature improvement. The extension should clear out all of the electoral district data on a contact record if the address is modified, or perhaps better, run the job on that contact to regenerate the boundaries.

d0325mgray commented 5 years ago

Any progress on this?

josephlacey commented 5 years ago

There's no new feature development planned. Deleting the old districting data associated with recently changed addresses will requeue it for new districting data.

d0325mgray commented 5 years ago

This could probably be handled by a CiviRule. I have set up a rule to tag contacts whose addresses have changed then manually delete the voting information. Maybe a new action could be created to do this automatically on an address change trigger

twomice commented 4 years ago

@josephlacey Would you be interested in a PR which uses hook_civicrm_post() to update a contact's Electoral records for any CRUD operation on that contact's address?

(I believe this will facilitate updates on address change as well as on contact merge.)

josephlacey commented 4 years ago

@twomice Sure, PR's welcome. I'll try to prioritize review when you're able to submit it.

d0325mgray commented 4 years ago

Yes

⁣DENNIS M. GRAY Cambodia:       +855 86 212 479 USA VoIP         +1 805 467 6070                            (Rings anywhere)         ​

On Dec 23, 2019, 22:24, at 22:24, Allen Shaw notifications@github.com wrote:

@josephlacey Would you be interested in a PR which uses hook_civicrm_post() to update a contact's Electoral records for any CRUD operation on that contact's address?

(I believe this will facilitate updates on address change as well as on contact merge.)

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/josephlacey/com.jlacey.electoral/issues/8#issuecomment-568503265

MegaphoneJon commented 4 years ago

@d0325mgray @twomice @andyburnsco I did a significant rewrite of this extension this week. My main goals were to support county and local-level data regardless of what it's called - i.e. counties couldn't be called "parishes" or "boroughs", and local "council districts" couldn't be "wards" or "precincts".

However, I did significant refactoring along the way, and a side effect is that I broke out the code that populates district data from the code that looks for addresses to update. I did this to facilitate testing, but a side effect is that this feature request would be trivial now, a few lines of code on the postCommit hook.

I definitely recommend testing this before deploying to production - my site doesn't launch for a couple of weeks - but there are a number of other improvements as well.