Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enum_field
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
enum_field
Commits
14b74514
Commit
14b74514
authored
1 year ago
by
Dieter Holvoet
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3410984
by DieterHolvoet: No field formatters are available
parent
9fb44542
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!2
Make all list field formatters also available for enum field types
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
enum_field.module
+14
-0
14 additions, 0 deletions
enum_field.module
with
14 additions
and
0 deletions
enum_field.module
+
14
−
0
View file @
14b74514
...
...
@@ -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'
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment