Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.0
-
Fix Version/s: 2.1.2
-
Component/s: CiviCRM API
-
Labels:None
Description
Previous bug reports have complained about the undocumented requirement that the $params passed in actually be a nested array consisting of
array( 'fieldParams' => $actual_params ) ... all well and good. Unfortunately, doing this results in errors such as
[debug_info] => INSERT INTO civicrm_option_group (name , label , is_active ) VALUES (': 2007_affiliation' , '2007 Affiliation' , 1 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`jw_civicrm/civicrm_option_group`, CONSTRAINT `FK_civicrm_option_group_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`))]
This seems to happen because around line 167 of api/v2/CustomGroup.php, the code starts expecting to find for even more (undocumented, confusing) array elements in $params, specifically $params['optionGroup'] and $params['customGroup'] – were these supposed to be generated internally?
CiviCRM 2.0.6
Drupal 5.11
PHP 5.2.6
MySQL 5.0.32