-
-
Notifications
You must be signed in to change notification settings - Fork 817
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
CRM-19386: Retrieve Activities custom fields in import parser #9072
Conversation
Can one of the admins verify this patch? |
jenkins, ok to test |
@@ -267,7 +267,7 @@ public function import($onDuplicate, &$values) { | |||
$params['source_contact_id'] = $session->get('userID'); | |||
} | |||
|
|||
$customFields = CRM_Core_BAO_CustomField::getFields(CRM_Utils_Array::value('contact_type', $params)); | |||
$customFields = CRM_Core_BAO_CustomField::getFields('Activity'); |
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.
Are you sure the contact custom fields will never be needed? If not, you could array_merge both.
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.
Sorry for my late answer... I don't know enough the CiviCRM code to tell if it will never be used. However, during all my tests the $params
array never contained an contact_type
key and I don't know where it could be defined elsewhere - and for which purpose since we are importing activities here, but I'm maybe wrong.
I could array_merge both as you suggest to be sure that it'll not introduce another bug. It's just that it will produce at least one more - and maybe useless - MySQL query.
Tell me what I have to do! :)
@civicrm-builder add to whitelist |
It took a look at whether it is possible to import contact fields on the activity import and they don't show up, so I'm pretty sure the line that was altered was a never-worked-copy-and-paste ug. Merging based on @Stoob's testing and above analysis of safety |
Per comments, I can't see any evidence it is possible to import contact custom fields
CRM-19386: Retrieve Activities custom fields in import parser
Custom fields for Activities should be retrieved - as it's done in CRM/Activity/Import/Parser.php - instead of contact ones when importing activities. Should it also filter custom fields on the
activity_type_id
?