Hi,

If a fieldset isn't collapsible vertical_tabs.js will copy all elements wrapped in a DIV into fieldsetContents, the problem is certain elements, like a FAPI button, aren't wrapped in a DIV and are therefore being sent to a pit of loneliness.

Simple fix, appears to work without introducing any issues, and not a patch because I'm still lazy:

Change:

      if (fieldsetContents.size() == 0) {
        fieldsetContents = $('<div class="fieldset-wrapper"></div>');
        $('.vertical-tabs-' + k).children('div').appendTo(fieldsetContents);
      }

To:

      if (fieldsetContents.size() == 0) {
        fieldsetContents =  $('.vertical-tabs-' + k);
      }

I'm sure I'm overlooking some obvious reason that it was done the other way, but this change is currently working well for me.

Cheers,
Deciphered.

CommentFileSizeAuthor
#1 nondiv-vertical_tabs.patch643 bytessmoothify

Comments

smoothify’s picture

Title: Elements not wrapped in DIV excluded » Form elements without DIV wrapper excluded from tab pane
StatusFileSize
new643 bytes

I experienced this issue too with CCK date fields (with start and end dates). If the field is in a CCK field group, when you edit the form it does not appear anywhere.

The problem is that the date form widget returns a <fieldset>...</fieldset> wrapper in its html output. As mentioned above the vertical_tabs,js file only deals with nested div tags and nothing else.

When I used code suggested by Deciphered (above), the date fields did display correctly, but it was also displaying a fieldset and a legend tag which messed with the visual look of the tabs.

I have attached a more selective patch, that retains the fieldset-wrapper div, and also excludes the legend tag. It could be made more selective if there is a reason to filter certain tags from the display.

jbomb’s picture

I ran into the same issue with the Location module. smoothify's patch worked for me. Thanks!

quicksketch’s picture

Status: Needs review » Fixed

Thanks smoothify, committed!

Status: Fixed » Closed (fixed)

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