-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dedupe selected fields, simplify, removed greeting id fields #29632
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
$contactTypeFields = [ | ||
'Organization' => [ | ||
'legal_name' => 'Legal Name', | ||
'organization_name' => 'Organization Name', | ||
'sic_code' => 'Sic Code', | ||
], | ||
'Individual' => [ | ||
'birth_date' => 'Birth Date', | ||
'is_deceased' => 'Deceased', | ||
'deceased_date' => 'Deceased Date', | ||
'first_name' => 'First Name', | ||
'formal_title' => 'Formal Title', | ||
'gender_id' => 'Gender ID', | ||
'prefix_id' => 'Individual Prefix', | ||
'suffix_id' => 'Individual Suffix', | ||
'job_title' => 'Job Title', | ||
'last_name' => 'Last Name', | ||
'middle_name' => 'Middle Name', | ||
], | ||
'Household' => [ | ||
'household_name' => 'Household Name', | ||
], | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This metadata already exists in DAO_Contact::getFields()
. E.g. the household_name
field has this:
civicrm-core/CRM/Contact/DAO/Contact.php
Line 1740 in 323a49a
'contactType' => 'Household', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemanw yeah - but the point of hard-coding it in the test is to make sure it doesn't change at all & this is a static reference to id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok sure. As long as the live code is reading from the metadata. Is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemanw yep - the live code is readying from DAO::import()
but I want to switch it to reading from the api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overview
Dedupe selected fields, simplify, removed greeting id fields
Before
The code was previously shared with import & is super confusing + has some stuff that is really for import, not dedupe.
Functionally the 3 fields that hold greeting IDs don't make sense for dedupe - ie email_greeting_id, postal_greeting_id, addressee_id could only really have crept into dedupe fields because they make sense for importing.
e.g in this image 'Addressee' disappears from the list
After
I removed the 3 greeting id fields & the complex code that adds them, but otherwise no change to returned fields, but added test cover to lock the results of this function in
Technical Details
Comments