[#4] (wip) Process custom fields parameter

This commit is contained in:
Jens Schuppe 2019-08-05 16:34:35 +02:00
parent 4537ac540a
commit 73481fb7ed
3 changed files with 78 additions and 0 deletions

View file

@ -99,6 +99,16 @@ class CRM_Twingle_Submission {
}
$params['gender_id'] = $gender_id;
}
// Validate custom fields parameter, if given.
if (!empty($params['custom_fields'])) {
if (!is_array($custom_fields = json_decode($params['custom_fields'], TRUE))) {
throw new CiviCRM_API3_Exception(
E::ts('Invalid format for custom fields.'),
'invalid_format'
);
}
}
}
/**