Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 3.1.5, 3.1.6, 3.2
-
Fix Version/s: 4.3.0
-
Component/s: CiviCRM API
-
Labels:None
Description
This is a meta issue of which CRM-6639 is one example.
The arrays returns by most CIviCRM API 'get' or 'search' functions are not valid parameters for the corresponding add/create functions. Frequently this is because date formats are different. Sometimes key names are different. Sometimes there is inconsistency whether a numeric ID or string label is expected.
The result is that large amount of 'massaging code' is required to do things like copying an existing record.
Similar inconsistencies exist with the 'objects' (sometimes arrays) passed to the pre/post hooks. E.g., the Contribution array passed to hook_civicrm_pre for a contrbituion is not a valid array for civicrm_contribute_create().