Skip to content

Instantly share code, notes, and snippets.

@joelpittet
Created November 18, 2012 05:59
Show Gist options
  • Save joelpittet/4103825 to your computer and use it in GitHub Desktop.
Save joelpittet/4103825 to your computer and use it in GitHub Desktop.
diff --git a/core/includes/form.inc b/core/includes/form.inc
index 85d1474..35e175b 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -5221,12 +5221,7 @@ function template_preprocess_form_element(&$variables) {
$variables['children'] = $element['#children'];
if (isset($element['#description'])) {
- $attributes = array();
- if (!empty($element['#id'])) {
- $attributes['id'] = $element['#id'] . '--description';
- }
$variables['description'] = $element['#description'];
- $variables['description']['attributes'] = new Attribute($attributes);
}
else {
unset($variables['description']);
diff --git a/core/themes/stark/templates/form.inc/form-element.html.twig b/core/themes/stark/templates/form.inc/form-element.html.twig
index 77d2851..d2a4d42 100644
--- a/core/themes/stark/templates/form.inc/form-element.html.twig
+++ b/core/themes/stark/templates/form.inc/form-element.html.twig
@@ -59,7 +59,7 @@
{% endif %}
{% if description %}
- <div class="description {{ description.attributes.class }}" {{- description.attributes }}>{{ description }}</div>
+ <div class="description">{{ description }}</div>
{% endif %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment