Field description div does not have classes if set before input
https://cgit.drupalcode.org/bootstrap/tree/templates/input/form-element....

For some reason if you put description before input you don't get any classes for the div. I'm guessing nobody noticed because it's not possible to put the description before input easily. I do it like this in theme file:

/**
 * Implements hook_element_info_alter().
 */
function THEME_element_info_alter(array &$info) {
  // @todo: add more fields here.
  $info['email']['#description_display'] = 'before';
  $info['select']['#description_display'] = 'before';
  $info['textarea']['#description_display'] = 'before';
  $info['textfield']['#description_display'] = 'before';
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hkirsman created an issue. See original summary.

hkirsman’s picture

Patch included. This will add class attribute with 2 classes. Example:

<div id="edit-field-bc-description-0-value--description" class="description help-block">
  A short summary.
</div>

  • markcarver committed 51e6d0b on 8.x-3.x authored by hkirsman
    Issue #3024796 by hkirsman: Input description div is missing classes if...
markhalliwell’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Component: Code » Templates
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.