Selecting a default value seems to have no effect on the widget when displayed in the node. Easily reproducible by creating a new field of type text and choose Select or Checkbox/Radio buttons as the type. Enter a couple values and then set one to be the default.

With a default value selected, required=no, '-None-' option appears and the default value is not selected by default. With required=yes, '-None-' no longer appears but the default value is not selected (radio buttons select no button by default and the select list selects the first available entry).

It looks like this has been reported many times:
#1409526: Problems with select items, default value and mandatory option.
#224391: Optionwidgets don't work for 'default value' setting
#256694: Select list default not saving
#251338: Default Value Doesn't Hold

Confirmed with both 3.0-alpha3 and 6.x-2.9.

Each time no response or being closed as a duplicate of the original issue that was reported against 5.x and then closed because 5.x is no longer supported.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stewart.adam’s picture

Attached patch seems to fix the issue for me. It checks the $field variable for a default value and if one is found, uses its option index instead of NULL. Otherwise, NULL as the default value as it was before.