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.
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
)
)