Commit 593a07a2 authored by jaapjansma's avatar jaapjansma

Changed get event output spec.

parent 172e45eb
......@@ -75,12 +75,25 @@ class GetEvent extends AbstractAction {
$type = 'Integer';
break;
}
$fieldSpec = new Specification(
$field['name'],
$type,
$field['title'],
false
);
if (stripos($field['name'], 'custom_') === 0) {
// It is a custom field
$customFieldId = str_replace("custom_", "", $field['name']);
$fieldName = CustomField::getCustomFieldName($customFieldId);
$fieldSpec = new Specification(
$fieldName,
$type,
$field['title'],
false
);
$fieldSpec->setApiFieldName($field['name']);
} else {
$fieldSpec = new Specification(
$field['name'],
$type,
$field['title'],
false
);
}
$bag->addSpecification($fieldSpec);
}
......
......@@ -88,7 +88,7 @@ class CustomField {
$apiFieldName = 'custom_'.$customField['id'];
$type = self::getTypeForCustomField($customField);
$title = trim($titlePrefix.$customField['label']);
$is_required = $customField['is_required'] && $useRequiredFromCustomField ? true : false;
$is_required = isset($customField['is_required']) && $customField['is_required'] && $useRequiredFromCustomField ? true : false;
$multiple = false;
$default = null;
$spec = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment