From 6973baa31e312d30010eb7ffee755e5f5a7515a8 Mon Sep 17 00:00:00 2001 From: Ryan Wyllie Date: Mon, 24 Jul 2017 06:59:39 +0000 Subject: [PATCH] MDL-59382 form: fix name in template context --- lib/form/templatable_form_element.php | 1 + .../boost/templates/core_form/element-template-inline.mustache | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/form/templatable_form_element.php b/lib/form/templatable_form_element.php index 7d8c2abb804..beb7173f7f9 100644 --- a/lib/form/templatable_form_element.php +++ b/lib/form/templatable_form_element.php @@ -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); diff --git a/theme/boost/templates/core_form/element-template-inline.mustache b/theme/boost/templates/core_form/element-template-inline.mustache index 88593fccdcb..55e16c5ebbd 100644 --- a/theme/boost/templates/core_form/element-template-inline.mustache +++ b/theme/boost/templates/core_form/element-template-inline.mustache @@ -4,7 +4,7 @@ {{#required}}{{#pix}}req, core, {{#str}}required{{/str}}{{/pix}}{{/required}} {{#advanced}}!{{/advanced}} - + {{$ element }} {{/ element }}