Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-3376

Contact Primary location gets wiped out when using locations through a profile


    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0, 2.1
    • Component/s: Core CiviCRM
    • Labels:


      Spent the last couple hours doing my best to narrow this bug down and report exactly what I think is going on.

      Duplicated by..
      1. Create two profiles that both load on the drupal user edit screen. One that pulls an individuals "home" address information and another that pulls an individuals "work" address information. (note: this does not work if you add all home and work address fields into 1 profile.. I actually set my system up that way to get around this bug)

      2. Through the contact record edit page make sure the user has both home and work location information filled out and take note of which one is set to the users primary location

      3. Go to the users drupal edit screen and edit the profile that holds the users "primary" location information.. I think it defaults to home. I checked which one was to to primary by checking the civicrm_address table and seeing what location has "is_primary" field set to 1. (note: It would be a good idea to take note of the changes going on in the db to get an idea of exactly what this bug is doing)

      4. Now hit save on the profile that holds the primary location information. You'll notice all appears well and both home and work information is still there.

      5. Now go to the profile edit screen for the drupal user that holds the information for the location that is not the primary location. Make some changes and hit save. You'll notice that the primary location information is now completely gone but the work information is still there. If you look at the contacts entries in the civicrm_address table you see there is now 2 entries of the same location type for the same contact.

      It appears what is happening is when the profile for the non primary location is submitted the information for that location .. including its location type id is overwriting either all the other locations.. or maybe just the primary locations information. Leaving you with multiple locations entries of the same type for the same contact.




            • Assignee:
              kiran.jagtap Kiran Jagtap
              agn507 Anthony Neumann
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: