Field widget label and help text missing

Created on 14 September 2012, about 13 years ago
Updated 22 October 2025, 15 days ago

I just installed the module and chose the "Shorthand input" widget. I added some help text based on the text from the module page, but it didn't show on the node add form. I tried the "CIDR input" widget too, but it wasn't until I tried the "Long input" widget that the help text and field label appeared.

After looking at the code, I found the field_ipaddress_field_widget_form function had a switch statement with cases for each type of widget. The first block handled the "Long input" widget, and had a noticeable difference compared to the remaining two widget code blocks.

Working:

      $element += array(
        '#type' => 'fieldset',
        '#element_validate' => array('_field_ipaddress_validate_long'),
      );

Not working:

      $element += array(
        '#element_validate' => array('_field_ipaddress_validate_long'),
      );

Adding the '#type' => 'fieldset' code to the last two widgets seemed to fix the problem immediately.

πŸ› Bug report
Status

Closed: outdated

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States thirdender

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024