MDL-59382 form: fix name in template context

This commit is contained in:
Ryan Wyllie 2017-07-24 06:59:39 +00:00
parent a50768b97f
commit 6973baa31e
2 changed files with 2 additions and 1 deletions

View File

@ -78,6 +78,7 @@ trait templatable_form_element {
$otherattributes[] = $attr . '="' . s($value) . '"';
}
}
$context['name'] = $context['name'] ?: $this->getName();
$context['extraclasses'] = $extraclasses;
$context['type'] = $this->getType();
$context['attributes'] = implode(' ', $otherattributes);

View File

@ -4,7 +4,7 @@
{{#required}}<abbr class="initialism text-danger" title="{{#str}}required{{/str}}">{{#pix}}req, core, {{#str}}required{{/str}}{{/pix}}</abbr>{{/required}}
{{#advanced}}<abbr class="initialism text-info" title="{{#str}}advanced{{/str}}">!</abbr>{{/advanced}}
</label>
<span data-fieldtype="{{element.type}}">
<span id="{{element.id}}" data-fieldtype="{{element.type}}">
{{$ element }}
<!-- Element goes here -->
{{/ element }}