If you add a required List (text) field, displayed as checkboxes, then, make it dependent on another field, the label of the field won't show up. For this to happen the field must be required.

Checkboxes and radios should have a 'form_pre_render_conditional_form_element' function in its pre-render array in order to display a label. The issue is that when a field is required conditional_fields adds a pre_render function to the element array (form_pre_render_conditional_form_element), and this seems to prevent drupal from adding the other pre_render function.

To me this seems like a core drupal bug.

Attached is a patch.

I hope this is clear =P.

CommentFileSizeAuthor
#2 pre_render.patch1.14 KBjackbravo
pre_render.patch1.25 KBjackbravo

Comments

jackbravo’s picture

Ok, yes, this is a core issue: #914792: Custom element properties entirely override default element info properties.

See comment #38. I agree.

jackbravo’s picture

StatusFileSize
new1.14 KB

Until that issue is resolved, here is a better patch.

AtomicTangerine’s picture

works for me! Thank you so much for the nice short patch, I thought I was the problem, turns out it's silly core again.

jackbravo’s picture

Status: Active » Reviewed & tested by the community

Marked as reviewed then =).

peterpoe’s picture

Status: Reviewed & tested by the community » Fixed

Very good, reviewed and committed to dev, thanks!

Status: Fixed » Closed (fixed)

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