-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
[REF][Import] (minor) Extract getHightlightedFields #23304
[REF][Import] (minor) Extract getHightlightedFields #23304
Conversation
(Standard links)
|
CRM/Contact/Import/Form/MapField.php
Outdated
private function getHighlightedFields(): array { | ||
$entityFields = [ | ||
'Individual' => ['first_name', 'last_name'], | ||
'Organization' => 'organization_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.
'Organization' => 'organization_name', | |
'Organization' => ['organization_name'], | |
'Household' => ['household_name'], |
Otherwise you get
Error: [] operator not supported for strings in CRM_Contact_Import_Form_MapField->getHighlightedFields()
when it tries to append email to the array, which is not an array.
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.
opps! fixed
Also it's not from this PR but somewhere along the line the list of map fields has become always Individual fields. e.g. on dmaster.demo choose Organization as the type - the list on the mapfields page is for Individuals. |
5db820f
to
09594ee
Compare
@demeritcowboy I can see where the other issue crept in - it will be easier to fix if I can get some of the other import PRs merged - but if they don't look to be merging in time for the rc I'll have to do a fix for just that. |
I think this one in particular #23288 - would make it easier to do a good fix for the regression you found - since a lot of code can start to be unwound after that |
thanks @demeritcowboy |
Overview
[REF][Import] (minor) Extract getHightlightedFields
Before
Long block of code, switch...
After
Extracted function
Technical Details
$contactType = $this->getContactType();
returns a word,$this->get('contactType')
returns a constantself::$customFields
is not used elsewhereComments