eileenmcnaughton / nz.co.fuzion.csvimport

Import to API using csv GUI
GNU Affero General Public License v3.0
8 stars 27 forks source link

PHP warnings in CRM_Csvimport_Task_Import::validateField() #43

Open kenwest opened 3 years ago

kenwest commented 3 years ago

I get PHP warnings when importing Relationships. The field mapping uses "Relationship Type ID (Match using name_a_b)".

The function assumes $value is a string, but what get's passed in is the following array: [[api.RelationshipType.get] => [[sequential] => 1, [return] => [[0] => id], [name_a_b] => VALUE]]

The outcome is that validateField() returns the outcome that relationship_type_id is set to NULL to validateFields() and thence to CRM_Csvimport_Task_Import::ImportEntity(). The NULL gets passed into civicrm_api3 'create' and doesn't seem to do any harm.

ImportEntity() has some code to "check for api chaining in params and run them separately" so it seems the issue is with validateField().

kenwest commented 3 years ago

I am able to work around this issue by using the field mapping "Relationship Type ID"