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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
ui_patterns
Merge requests
!165
Issue
#3465432
by pdureau, Grimreaper: [2.0.0-beta1] empty variants in pattern() Twig function
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3465432
by pdureau, Grimreaper: [2.0.0-beta1] empty variants in pattern() Twig function
issue/ui_patterns-3465432:3465432-2.0.0-beta1-empty-variants
into
2.0.x
Overview
0
Commits
1
Pipelines
1
Changes
3
Merged
Florent Torregrosa
requested to merge
issue/ui_patterns-3465432:3465432-2.0.0-beta1-empty-variants
into
2.0.x
10 months ago
Overview
0
Commits
1
Pipelines
1
Changes
3
Expand
Closes
#3465432
0
0
Merge request reports
Compare
2.0.x
2.0.x (base)
and
latest version
latest version
aef08e90
1 commit,
10 months ago
3 files
+
10
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
modules/ui_patterns_legacy/src/Template/TwigExtension.php
+
7
−
1
Options
@@ -56,8 +56,14 @@ class TwigExtension extends AbstractExtension {
$element
=
[
'#type'
=>
'pattern'
,
'#id'
=>
$id
,
'#variant'
=>
$variant
,
];
// Variant is a JSON-schema enum where empty string is not always allowed.
// Moreover, we don't allow empty variant.
if
(
!
empty
(
$variant
))
{
$element
[
'#variant'
]
=
$variant
;
}
// We use the compact format, so it will be resolved by
// RenderableConverter::resolveCompactFormat() before being converted to
// the SDC format.
Loading