Commit 7b297499 authored by catch's avatar catch
Browse files

Issue #1949988 by amateescu, netsensei: Simplify field_entity_field_info() now...

Issue #1949988 by amateescu, netsensei: Simplify field_entity_field_info() now that all field types have a field item class.
parent 2ba6140a
......@@ -433,23 +433,20 @@ function field_entity_field_info($entity_type) {
foreach ($instances as $field_name => $instance) {
$field = field_info_field($field_name);
if (!empty($field_types[$field['type']]['field item class'])) {
// @todo: Allow for adding field type settings.
$definition = array(
'label' => t('Field !name', array('!name' => $field_name)),
'type' => isset($field_types[$field['type']]['data_type']) ? $field_types[$field['type']]['data_type'] : $field['type'] . '_field',
'configurable' => TRUE,
'translatable' => !empty($field['translatable'])
);
if ($optional) {
$property_info['optional'][$field_name] = $definition;
$property_info['bundle map'][$bundle_name][] = $field_name;
}
else {
$property_info['definitions'][$field_name] = $definition;
}
// @todo: Allow for adding field type settings.
$definition = array(
'label' => t('Field !name', array('!name' => $field_name)),
'type' => isset($field_types[$field['type']]['data_type']) ? $field_types[$field['type']]['data_type'] : $field['type'] . '_field',
'configurable' => TRUE,
'translatable' => !empty($field['translatable'])
);
if ($optional) {
$property_info['optional'][$field_name] = $definition;
$property_info['bundle map'][$bundle_name][] = $field_name;
}
else {
$property_info['definitions'][$field_name] = $definition;
}
}
}
......
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