Skip to content
Snippets Groups Projects

Issue #3465432 by pdureau, Grimreaper: [2.0.0-beta1] empty variants in pattern() Twig function

Merged Issue #3465432 by pdureau, Grimreaper: [2.0.0-beta1] empty variants in pattern() Twig function
3 files
+ 10
5
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -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