Details
- 
    Type:
Bug
 - 
    Status: Done/Fixed
 - 
    Priority:
Major
 - 
    Resolution: Won't Fix
 - 
    Affects Version/s: 3.0.2
 - 
    Fix Version/s: 4.3.0
 - 
    Component/s: Core CiviCRM
 - 
    Labels:None
 
Description
Was having an issue where a contacts primary location was being overridden after a profile was submitted that had fields from multiple location types (eg. work and home). After some investigation I found that the SQL in getPrimaryLocationType() looks first at the primary locaiton type in the email table, not the address table. Is there a reason for this?
I've attached a patch which solved the issue for me.