[#4] (wip) Process custom fields parameter
This commit is contained in:
parent
4537ac540a
commit
73481fb7ed
3 changed files with 78 additions and 0 deletions
|
@ -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'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue