commit 18eb65cb62ff63f422f373fd67cf97504c08e960 Author: Joel Pittet Date: Sun Jan 5 21:52:29 2014 -0800 fix whitepsace and call to theme function directly diff --git a/core/includes/form.inc b/core/includes/form.inc index 5b88317..f8edfdd 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -2846,7 +2846,13 @@ function template_preprocess_form_element_label(&$variables) { $element = $variables['element']; // If the element is required, a required marker is appended to the label. - $variables['required'] = !empty($element['#required']) ? theme('form_required_marker', array('element' => $element)) : ''; + $variables['required'] = array(); + if (!empty($element['#required'])) { + $variables['required'] = array( + '#theme' => 'form_required_marker', + '#element' => $element, + ); + } $variables['title'] = (isset($element['#title']) && $element['#title'] !== '') ? Xss::filterAdmin($element['#title']) : ''; $variables['attributes'] = array(); diff --git a/core/modules/system/templates/form-element-label.html.twig b/core/modules/system/templates/form-element-label.html.twig index bc96254..65e53a1 100644 --- a/core/modules/system/templates/form-element-label.html.twig +++ b/core/modules/system/templates/form-element-label.html.twig @@ -14,6 +14,6 @@ * @ingroup themeable */ #} -{% if title or required %} -{{ title }}{{ required }} -{% endif %} +{% if title is not empty or required -%} + {{ title }}{{ required }} +{%- endif %}