Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I created a boolean field using a radio button widget through the UI. I set a default value but when I go to the checkout page, there's no value selected by default.
Comments
Comment #1
brogdawg CreditAttribution: brogdawg commentedI am experiencing the same issue. Boolean field with on off checkbox. Setting the default to be on (checked) doesn't default the field to be checked on the checkout pane.
Comment #2
brogdawg CreditAttribution: brogdawg commentedAs a workaround I ended up setting the default value to 1 (checked) in a hook_form_alter in my custom module. Here is the code.
Comment #3
xandeadx CreditAttribution: xandeadx commented