This issue occurs when using a custom form element of type 'tableselect', with the multiple option set to false (to provide radio buttons instead of checkboxes). If the form fails validation then the option selected by the client within the tableselect is forgotten when the form is re-rendered.

If the form is submitted successfully then the value submitted by the user is correctly sent through to the submit handler - which is good.

The problem does not occur when the tableselect is in the multiple mode (i.e. checkboxes).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mdixoncm’s picture

Status: Active » Needs review
FileSize
642 bytes

We have traced this down to form_process_tableselect - which has different logic when dealing with multiple or non multiple versions of the tableselect. The non multiple version is NOT utilising the $element['#value'] at any point - it is always using the original default_value from the element,

The following patch will make use of the $element['#value'].