2

WP 6.03, CiviCRM 5.51.3, API CSV importer 1.1. I'm attempting to import an activity via this extension since I need to include the assignee (which isn't included in the standard activity import). The queue runner hangs each time without completing.

These are the fields I'm including: activity type (I've tried both the ID and the label), activity date, source contact (using contact ID), target contact (using contact ID), assignee contact (using contact ID), status, subject, priority.

Inspecting the log shows me this error:

$CRM_Queue_ErrorPolicy_reportError = Array ( [is_error] => 1 [is_continue] => 0 [exception] => Error 1: Uncaught TypeError: Argument 1 passed to civicrm_api4() must be of the type string, null given, called in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php on line 1470 and defined in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/api/api.php:62

Stack trace:

#0 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1470): civicrm_api4(NULL, 'getFields', Array)

#1 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1408): CRM_Import_Parser->getFieldMetadata('source_contact_...', true)

#2 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1364): CRM_Import_Parser->getFieldOptions('source_contact_...')

#3 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1857): CRM_Import_Parser->getTransformedFieldValue('source_contact_...', '56186')

#4 /home/XXXX/www/www/wp-content/uploads/civicrm/extensions/nz.co.fuzion.csvimport/CRM/Csvimport/Import/ in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/api/api.php, line 62 [last_task_title] => Processed 1 rows out of 1 )

This would seem to suggest that I'm missing a required field but it's really difficult to tell, and of course there's no error guidance generated. Any ideas where my problem lies?

4
  • and you definitely had your date format right? have you tested your csv (anonymised) on eg dmaster.demo.civicrm.org just to compare. you can add the ext' n via dmaster.demo.civicrm.org/civicrm/admin/…
    – petednz - fuzion
    Oct 20, 2022 at 2:07
  • I tested multiple date formats, confirming each time that they matched - no luck. However, I did not test on the demo site; I'll do that next. Thanks for the suggestion. Oct 24, 2022 at 12:16
  • Testing on the demo site resulted in the same thing - no activity added, and no discernible error. I also added the Log Viewer module and the log entries are as follows: [info] Running task: Processed 1 rows out of 1 Oct 28, 2022 at 17:49
  • may be time to open an Issue on the extension repo with steps how to replicate
    – petednz - fuzion
    Oct 29, 2022 at 21:16

1 Answer 1

0

On 5.63 and 5.67 (dmaster) this works with the API CSV extension 1.12. May have been an issue on 1.1.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.