Description not shown in form.
so i change the code from file select_or_other.module in line 93
from

  $element['select'] = array(
    '#type' => $element['#select_type'],
    '#title' => $element['#title'],
    '#title_display' => $element['#title_display'],
    '#default_value' => $element['#default_value'],
    '#disabled' => $element['#disabled'],
    '#multiple' => $element['#multiple'],
    '#required' => $element['#required'],
    '#size' => $element['#size'],
    '#options' => $element['#options'],
    '#attributes' => $element['#attributes'],
    '#weight' => 10,
  );

to

  $element['select'] = array(
    '#type' => $element['#select_type'],
    '#title' => $element['#title'],
    '#title_display' => $element['#title_display'],
    '#default_value' => $element['#default_value'],
    '#disabled' => $element['#disabled'],
    '#multiple' => $element['#multiple'],
    '#required' => $element['#required'],
    '#size' => $element['#size'],
    '#options' => $element['#options'],
    '#attributes' => $element['#attributes'],
    '#description' => $element['#description'], // add this line.
    '#weight' => 10,
  );

Comments

haydeniv’s picture

What configuration are you using where the description is not showing up? It works fine in my tests. Could you post screenshots of it not working?

ijortengab’s picture

StatusFileSize
new142.76 KB

Image 1. I create a new field, name: Usia.
Image 2. Add description
Image 3. But, that description was not available.
Image 4. I modified code, select_or_other.module line 93
Image 5. add a new line
Image 6. Clear Cache
Image 7. Bingo, the description has available.
Preview

dave reid’s picture

I cannot confirm that this is actually a bug in the latest release. My field's help text is displaying below the select or other field without any changes required like all my other field API fields.

dave reid’s picture

Status: Needs review » Postponed (maintainer needs more info)
haydeniv’s picture

I thought this problem might be because of the field group but it worked fine for me even when it was in a group. Are you sure you are using the latest dev release?

haydeniv’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing this. Should work in latest release.

kylesmith’s picture

Component: Forms API (Developers) » Field widget (non-specific or listed)
Issue summary: View changes
StatusFileSize
new1001 bytes

I had the same problem as ijortengab in his initial post, and his solution works for me so I'm providing a patch for it.

I am using the latest select_or_other version, 7.x-2.22.

I had altered my site's theme template.php to move the description text so it appears after the label and before the field input, rather than the theme's default displaying it after the input (ref https://groups.drupal.org/node/206593#comment-747503). From ijortengab's last screenshot it looks like he had done the same. I'm wondering if this theme altering caused the select or other description to not show and if that is why haydeniv could not reproduce it.