Skip to content
Snippets Groups Projects
Commit 14b74514 authored by Dieter Holvoet's avatar Dieter Holvoet
Browse files

Issue #3410984 by DieterHolvoet: No field formatters are available

parent 9fb44542
Branches
Tags
1 merge request!2Make all list field formatters also available for enum field types
......@@ -18,3 +18,17 @@ function enum_field_field_widget_info_alter(array &$info): void {
}
}
}
/**
* Implements hook_field_formatter_info_alter().
*/
function enum_field_field_formatter_info_alter(array &$info): void {
foreach ($info as &$fieldInfo) {
if (in_array('list_integer', $fieldInfo['field_types'], TRUE)) {
$fieldInfo['field_types'][] = 'enum_integer';
}
if (in_array('list_string', $fieldInfo['field_types'], TRUE)) {
$fieldInfo['field_types'][] = 'enum_string';
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment