$attributes = &$option['attributes'];
$html_type = $attributes['html_type'];
$data_type = $attributes['data_type'];
+ // set $id as $fieldID if not passed in the params.
+ if (empty($fieldID)) {
+ $fieldID = $id;
+ }
return self::getDisplayValueCommon($value,
$option,
$html_type == 'Multi-Select'
)
) {
+ // Keep only the custom option 'key' => 'value' pair
+ // to avoid return of unnecessary data from the hook.
+ if (isset($option['attributes'])) {
+ unset($option['attributes']);
+ }
CRM_Utils_Hook::customFieldOptions($fieldID, $option);
}