CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Problem with address updates
Pages: [1]

Author Topic: Problem with address updates  (Read 1678 times)

rogerco

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 5
Problem with address updates
August 14, 2008, 04:37:26 am
J1.5.6, Civi2.0.5
Individual contact set to use household address
Profile A to view individual address
Profile B to edit household address

Use profile B to edit household address on front end -> individual address not updated. New household address shows in backend when viewing household but NOT in backend when viewing individual or in frontend when using Profile B

Edit household address in backend -> individual address is updated and new address shows when viewing individual in backend and in both profiles A & B on front end.

What is going on? Why is editing the household address using the profile not being reflected in the individual address?

RogerCO

rogerco

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 5
Re: Problem with address updates
August 14, 2008, 05:17:15 am
Further to which it doesn't work the other way either:

Profile C to edit individual's address -> updates individual address in backend and frontend (profile A) but doesn't cascade the update to the household address, although the individual contact is set to use household address.

Looking in the tables it seems that when you flag an individual to use household address the address data is actually copied into the individual record (data replication = bad practice) rather than being linked, and it is only the backend admin editing functions that are correctly respecting the flag and updating the individual address fields. Profiles do not pay any attention to the use household address flag.

Any ideas for a workaround? Is this fixed in 2.1? Should I file a bug report? (where?)

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Problem with address updates
August 14, 2008, 09:47:19 pm
You're right - the current methodology for Use Household Address is to clone the household address to the individual's. I think this was basically a hack to get the feature in under time constraints - however it also has some benefits for cases where household relationship is removed etc.

We are open to refactoring the approach (although not for 2.1). Perhaps this is a project you want to participate in - design and coding - once we branch the 2.1 codebase (which we will do when we hit beta).
Protect your investment in CiviCRM by  becoming a Member!

rogerco

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 5
Re: Problem with address updates
August 15, 2008, 01:04:00 am
Aaha, thanks,
That explains things, and also explains why no one else at the UK User Group meeting was attempting to use the Household address facility.

Certainly something we should fix in a future release, and I'm up for helping with that if I can.

In the meantime I need to think through the workflow associated with handling joint members (2 individuals with same address) and avoiding duplicates in printing address labels.

What I really need is to be able to run some code that triggers on submitting the profile form which updates the individual address. The code would be passed the contact id, find the corresponding household address and update that, and then check if there was anyone else linked to that household and go and update their individual address.
Or alternatively if the profile updated the household address then the code would look for all individuals linked to that household and update their individual addresses.

I guess this could be done by using the on-save redirect url specified in the profile, but how would I pass it a parameter to tell it which contact had just been edited ? ....

RogerCO

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Problem with address updates
August 18, 2008, 11:52:43 am

you can use the profile post hook and intercept all calls on profile(s) create/edit

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Problem with address updates

This forum was archived on 2017-11-26.