Score:0

How to remove the fieldsets that are pup around "list (text)" fields that have their display set to "Check Boxes / Radio Button"?

ng flag

We have a Drupal 9 website and are using "list (text)" fields whose displays are set to "Check Boxes/ Radio Button". This causes the output to be wrapped in a field set which we need to remove.

I have tried some trial and error (guessing) at altering the field in hook_form_alter() but the fieldset remains.

enter image description here The field variable is below:

Array
(
    [#type] => container
    [#parents] => Array
        (
            [0] => field_order_item_logo_wrapper
        )

    [#attributes] => Array
        (
            [class] => Array
                (
                    [0] => field--type-list-string
                    [1] => field--name-field-order-item-logo
                    [2] => field--widget-options-buttons
                )

        )

    [widget] => Array
        (
            [#title] => Image / Logo
            [#description] => 
            [#field_parents] => Array
                (
                )

            [#required] => 1
            [#delta] => 0
            [#weight] => 0
            [#element_validate] => Array
                (
                    [0] => Array
                        (
                            [0] => Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsButtonsWidget
                            [1] => validateElement
                        )

                )

            [#key_column] => value
            [#type] => radios
            [#default_value] => custom_logo
            [#options] => Array
                (
                    [custom_logo] => stdClass Object
                        (
                            [__CLASS__] => Drupal\Core\Field\FieldFilteredMarkup
                            [string:protected] => Provide Logo
                        )

                    [stock_art_as_shown] => stdClass Object
                        (
                            [__CLASS__] => Drupal\Core\Field\FieldFilteredMarkup
                            [string:protected] => Stock Art As Shown
                        )

                    [stock_logo] => stdClass Object
                        (
                            [__CLASS__] => Drupal\Core\Field\FieldFilteredMarkup
                            [string:protected] => Stock Logo
                        )

                    [no_logo] => stdClass Object
                        (
                            [__CLASS__] => Drupal\Core\Field\FieldFilteredMarkup
                            [string:protected] => No Logo
                        )

                    [logo_on_file] => stdClass Object
                        (
                            [__CLASS__] => Drupal\Core\Field\FieldFilteredMarkup
                            [string:protected] => Logo is on File
                        )

                    [repeat] => stdClass Object
                        (
                            [__CLASS__] => Drupal\Core\Field\FieldFilteredMarkup
                            [string:protected] => Repeat Exact Style as Previous Order
                        )

                )

            [#after_build] => Array
                (
                    [0] => Array
                        (
                            [0] => Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsButtonsWidget
                            [1] => afterBuild
                        )

                )

            [#field_name] => field_order_item_logo
            [#parents] => Array
                (
                    [0] => field_order_item_logo
                )

            [#tree] => 1
        )

)
apaderno avatar
us flag
The screenshot shows an *Order Type* fieldset with the *New Order* and *Repeat Order* radio-buttons. What shown as field value contains a container (not a fieldset) and the *Provide Logo*, *Stock Art As Shown*, *Stock Logo*, **, *No Logo*, *Logo is on File*, and *Repeat Exact Style as Previous Order* radio-buttons. It seems the screenshot is for an entity field, but the field value is for another entity field.
Score:1
pw flag

Tried to replicate with same settings as you have mentioned but for me its not adding field set please check it might be your theme settings

enter image description here

enter image description here

enter image description here

quantumized avatar
ng flag
Interesting. Thank you for test and providing the screenshots. This is interesting then, I can't figure out where these fieldsets are being inserted for the radio/checks display. I'll dig in deeper.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.