Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ui_patterns
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
ui_patterns
Merge requests
!321
Issue
#3497683
by grimreaper, pdureau, just_like_good_vibes: [2.0.0-rc2] Field formatter does not check empty field
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Issue
#3497683
by grimreaper, pdureau, just_like_good_vibes: [2.0.0-rc2] Field formatter does not check empty field
issue/ui_patterns-3497683:3497683-2.0.0-rc2-field-formatter
into
2.0.x
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Issue #3497683 by grimreaper, pdureau, just_like_good_vibes: [2.0.0-rc2] Field formatter does not check empty field
Mikael Meulle
requested to merge
issue/ui_patterns-3497683:3497683-2.0.0-rc2-field-formatter
into
2.0.x
7 months ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Closes
#3497683
0
0
Merge request reports
Compare
2.0.x
2.0.x (base)
and
latest version
latest version
bc3e0126
1 commit,
7 months ago
1 file
+
3
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
modules/ui_patterns_field_formatters/src/Plugin/Field/FieldFormatter/ComponentFormatter.php
+
3
−
0
View file @ bc3e0126
Edit in single-file editor
Open in Web IDE
Show full file
@@ -28,6 +28,9 @@ class ComponentFormatter extends ComponentFormatterBase {
* {@inheritdoc}
*/
public
function
viewElements
(
FieldItemListInterface
$items
,
$langcode
)
{
if
(
count
(
$items
)
===
0
)
{
return
[];
}
$context
=
$this
->
getComponentSourceContexts
(
$items
);
$context
[
'ui_patterns:lang_code'
]
=
new
Context
(
new
ContextDefinition
(
'any'
),
$langcode
);
$context
[
'ui_patterns:field:items'
]
=
new
Context
(
new
ContextDefinition
(
'any'
),
$items
);
Loading