Conversation from #drupal-support IRC channel:

<asdf2345> i am currently using drupl 8 and a bootstrap subtheme. for some reason my radios (custom module) are becoming fieldsets. how can i just render them as radios instead?
[09:53 PM] <markcarver> asdf2345: that's currently a bug due to how d8 wraps checkboxes/radios in a composite form element trait
[09:53 PM] <markcarver> asdf2345: see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21CompositeFormElementTrait.php/function/CompositeFormElementTrait%3A%3ApreRenderCompositeFormElement/8
[09:54 PM] <markcarver> which, IMO, is a really sh!tty thing to do
[09:54 PM] markcarver doesn't even know how that got in
[09:57 PM] <asdf2345> bartik seems to not have the same issue? any thoughts on where i would lok for the code to emulate, or some documentation on a fix?
[09:59 PM] markcarver hates it when people use core theme as a "standard"
[10:00 PM] <asdf2345> its not so much a standard as it isnt turning the radios into a fieldset
[10:00 PM] <markcarver> asdf2345: the reason it's showing up as a panel in bootstrap is because the bootstrap base theme overrides details/fieldset element types with bootstrap panels
[10:00 PM] <asdf2345> ok
[10:00 PM] <markcarver> asdf2345: it does turn them into a fieldset in bartik, it just doesn't style them
[10:01 PM] <asdf2345> youre right, i see that now
[10:02 PM] <asdf2345> thank you for the helpful information. i appreciate it
[10:02 PM] <markcarver> np
[10:02 PM] <markcarver> also fwiw, there's #drupal-bootstrap
[10:02 PM] <markcarver> for bootstrap related questions
[10:02 PM] <markcarver> albeit, not necessary a "support" channel
[10:02 PM] <asdf2345> ty again, i didnt realize. im still learning about the differences with d8
[10:03 PM] <markcarver> there's lots of little things like this that are done differently in d8
[10:05 PM] <markcarver> the "fix" will likely require adding an override of that pre_render composite trait so it doesn't use the "fieldset" theme wrapper
[10:05 PM] <markcarver> I just haven't figured out exactly how it should be done properly

See: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...

Comments

markcarver created an issue. See original summary.

markhalliwell’s picture

Fix will/should look similar to http://cgit.drupalcode.org/bootstrap/tree/src/Plugin/Prerender/Dropbutto..., but for the checkboxes and radios element types. I'm not sure, but we may be able to add both @BootstrapPrerender annotations in the same file.

Obviously, the render method would need to be similar to the contents of core's preRenderCompositeFormElement method, but changing the #theme_wrapper from a fieldset (which is converted to a panel later) to.... I'm not sure what yet?

Joao Informatico madrid’s picture

I have same issue. Here. Any easy fix for this?

markhalliwell’s picture

This can now be managed using the new #bootstrap_panel property.

markhalliwell’s picture

Status: Active » Fixed
StatusFileSize
new1.48 KB

  • markcarver committed e793a4f on 8.x-3.x
    Issue #2653084 by markcarver: Checkboxes/Radios are wrapped using a...

Status: Fixed » Closed (fixed)

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