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.
field_ui.module contains this code:
function field_ui_field_settings_form_submit($form, &$form_state) {
// Do not allow changes to fields with data.
if (field_ui_field_has_data($field)) {
return;
}
However, I was able to edit a List field with data on an existing node. Also note that I did not get the message, "There is data for this field in the database. The field settings can no longer be changed." So it looks like field_ui_field_has_data() is not working, which is odd because it only uses field_attach_query() which should be working.
Marked critical because if people edit fields with existing data in the wrong way, bad things can result.
Comments
Comment #1
bjaspan CreditAttribution: bjaspan commentedIt looks like field_ui_field_edit_form() does not check field_ui_field_has_data(), while field_ui_field_settings_form() does.
Comment #2
bjaspan CreditAttribution: bjaspan commentedThis is being addressed by #367013: Field update (field_update_field).