When using form with vertical tabs from Fieldgroup module and adding to it some required fields - the layout is completely broken after submit error. To reproduce:

1. 3.0 theme, no custom css
2. Some of vertical tabs with some required fields in them
3. Submit the form without filling required fields

Two errors will appear:
Active is the last tab with required unfilled fields, even if there are unfilled fields in the other tabs and even if the form was submitted from the other tab
The layout is broken - seems that all of the tabs contents (except first) is placed well below.

Tested with clean LESS based install.

Comments

playfulwolf’s picture

Issue summary: View changes

The same with 3.0 and 3.x releases, Bootstrap 3.0.0, 3.1.1 accordingly

taiger’s picture

This is still an issue. Unfortunately this makes Bootstrap unusable as an admin theme.

ckng’s picture

Since bootstrap 3.x-dev breaks all of my existing themes, have to fallback to 3.0.

This issue is related to #2158197: The vertical tab content is missing, got it working to some extend using partial of the js patch (not the tpl). However, there are some minor js error and no time to clean it up as patch, yet.

markhalliwell’s picture

Status: Active » Closed (fixed)

Scripted response: This issue has been closed while cleaning up the issue queue. This issue has already been addressed in 7.x-3.x-dev.

ominimo’s picture

I am seeing this issue in both 7.x-3.0 and 7.x-3.x-dev.

Is there any update on this issue? Has anyone found a fix?

m42’s picture

Version: 7.x-3.0 » 7.x-3.x-dev
Assigned: Unassigned » m42
Status: Closed (fixed) » Needs review
StatusFileSize
new1.31 KB

This behavior is due to an "incompatibility" with the Field Group module. Here is a patch that fixes the following :
- huge white spaces before tabs' contents
- red stars that did not appear if the tab was marked as mandatory. For this one, you should add the following somewhere in your CSS if you don't want the tab label to be bold :

div.vertical-tabs .vertical-tab-button strong{
    font-weight:normal;
}
ominimo’s picture

Thanks hbemtec. #6 works great but unfortunately does not address all the issues.

- there is still the remaining issue that the active tab is set to the last error, not the first. Any ideas on a fix for this?

- I have also highlighted .error states on the tabs (make the tabs text red). Including your css above this would then be either

div.vertical-tabs .vertical-tab-button strong {
  font-weight: normal;
}
div.vertical-tabs .vertical-tab-button.error strong,
div.vertical-tabs .vertical-tab-button.error span {
  font-weight: bold;
  color: #a94442;
}

or in less

div.vertical-tabs .vertical-tab-button {
	strong {
		font-weight: normal;
	}
	&.error {
		strong, span {	
		font-weight: bold;
		color: @state-danger-text;
		}
	}
}
m42’s picture

The "wrong tab" issue is not a Bootstrap issue, as I was able to reproduce it in another theme (Adminimal). It is Field Group module's normal behavior, implemented this way :

$('fieldset.vertical-tabs-pane', context).once('fieldgroup-effects', function(i) {
	[...]
	if ($('.error', $(this)).length) {
	  $(this).data('verticalTab').link.parent().addClass('error');
	  Drupal.FieldGroup.setGroupWithfocus($(this));
	  $(this).data('verticalTab').focus();
	}
});

As you can see, the following code is executed once, but for each vertical tab, which means every tab in error will get focus (and thus remove focus from the others). So, in the very end, the last tab in error will have the focus.
If you think this is an issue, you should probably address it to Field Group's queue.

By now, the patch solves what can be solved in this module. An additional patch should probably be done fot the CSS part, but I have no idea where to put that. If a maintainer reads these lines... :)

ominimo’s picture

Looks great hbemtec.

I have created an issue with Field Groups including a suggested fix.

p.s This is my first foray into creating/contributing issues. Hope I'm getting it right. :)

markhalliwell’s picture

Version: 7.x-3.x-dev » 7.x-3.0
Assigned: m42 » Unassigned
Status: Needs review » Closed (fixed)

Please..... do not hi-jack closed issues (especially for a module specific issue). Reference them in new issues... that's why we added those fields on d.o.