Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment