The behavior of a "locked" field is documented as "TODO: undefined," but it seems to be relatively well defined: If a field is locked, you can't edit it or create new instances via the UI. There's also a TODO about maximum lengths for field, widget, and formatter names.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ksenzee’s picture

Status: Active » Needs review
FileSize
1.35 KB

I had a quick look around, and I still don't know the maximum lengths for widget and formatter names, but here's a patch that documents locked fields and the maximum length for field names.

jhodgdon’s picture

http://api.drupal.org/api/function/_field_write_instance/7
It looks like the widget and formatter names are just stored in a serialized blob. They are $instance['widget'] and $instance['display']:

  // The serialized 'data' column contains everything from $instance that does
  // not have its own column and is not automatically populated when the
  // instance is read.
  $data = $instance;
  unset($data['id'], $data['field_id'], $data['field_name'], $data['entity_type'], $data['bundle'], $data['deleted']);

  $record = array(
    'field_id' => $instance['field_id'],
    'field_name' => $instance['field_name'],
    'entity_type' => $instance['entity_type'],
    'bundle' => $instance['bundle'],
    'data' => $data,
    'deleted' => $instance['deleted'],
  );

So I don't think they have any maximum length, at least not one enforced by the database.

ksenzee’s picture

I took a second look around, and I agree. Here's a rerolled patch with the TODO removed entirely.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine to me - thanks!

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.