Block form: radio buttons selection not saved I have a block form with 1 radio button and one text field.
The problem is the selection for the radio button is not saved: in blockSubmit $values['colour_select'] is empty.
The value of the text box is saved and working fine.
What is missing for the radio button?

Thank you

class UnitSiteIdentityBlock extends BlockBase implements BlockPluginInterface{
  public function build() {
    $config = $this-&gt;getConfiguration();
    $colour_select = $config['colour_select'];
    $custom_colour = $config['custom_colour'];
    return [
     '#theme' =&gt; 'folwell_unit_identity_block',
     '#colour_select' =&gt; $colour_select,
     '#custom_colour' =&gt; $custom_colour,
    ];
  }
  public function blockForm($form, FormStateInterface $form_state) {
    //$form = parent::blockForm($form, $form_state);
    $config = $this-&gt;getConfiguration();
    $form['colour_select'] = [
      '#type' =&gt; 'radios',
      '#title' =&gt; $this-&gt;t('Pick a colour'),
      '#options' =&gt; [
        'white' =&gt; $this-&gt;t('White'),
        'black' =&gt; $this-&gt;t('Black'),
        'other' =&gt; $this-&gt;t('Other'),
      ],
      '#attributes' =&gt; [
        'name' =&gt; 'field_select_colour',
      ],
      '#default_value' =&gt; $config['colour_select'],
    ];
    $form['custom_colour'] = [
      '#type' =&gt; 'textfield',
      '#size' =&gt; '60',
      '#placeholder' =&gt; 'Enter favourite colour',
      '#attributes' =&gt; [
        'id' =&gt; 'custom-colour',
      ],
      '#default_value' =&gt; $config['custom_colour'],
    ];
    return $form;
  }
  public function blockSubmit($form, FormStateInterface $form_state) {
    //parent::blockSubmit($form, $form_state);
    $values = $form_state-&gt;getValues();
    foreach ($values as $key =&gt; $value) {
      \Drupal::messenger()-&gt;addMessage($key . ': ' . $value);
    }
    $this-&gt;configuration['colour_select'] = $values['colour_select'];
    $this-&gt;configuration['custom_colour'] = $values['custom_colour'];
  }
}
I found the problem with this: it was the name attribute. As soon as I removed it, $values['colour_select'] stored the selected color.