D6 -> D7 field upgrade tasks

You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

This wiki page lists the steps for CCK D6 -> Code D7 fields upgrade.
It is based on a list KarenS maintained a few months ago, and might be incomplete or partially out of date.

Issue for creating module to update field data: http://drupal.org/node/366364

Documentation for developers on how to upgrade modules (in process): http://drupal.org/node/728792

Each field type will have its own bunch of reshuffling of the $field into the $field and $instance structures.

  • Add new columns for:
    • deleted: defaults to 0
    • data: contains serialized array of complete $instance.
  • Module-defined field settings are now at $field['settings'][...]
  • Module-defined instance settings are at $instance['settings'] (new in D7 - previously in D6 only widgets carried instance-level settings)
  • Field settings should be limited to settings that affect the schema, others should be instance settings whenever possible.
  • Module-defined widget settings are now at $instance['widget']['settings']
  • Module-defined formatter settings are at $instance['display'][$build_mode]['settings'] (new in D7 - in D6 a given formatter had one single monolithic behavior)
  • No more content type: $field['widget']['type_name'] becomes $instance['bundle']
  • Required is now $instance['required'] instead of $field['required']
  • Label is now $instance['label'] instead of $field['widget']['label']
  • Description is now $instance['description'] instead of $field['widget']['description']
  • Weight is now $instance['weight'] instead of $field['widget']['weight']
  • Multiple is now $field['cardinality'] instead of $field['multiple']
  • Display settings is now $instance['display'] instead of $instance['display_settings']
  • label display mode is now per build mode: $instance['display'][$build_mode] instead of $instance['display_settings']['label']
  • Names of build modes have changed (from numeric constants to strings)
  • widgets and formatter names are now prefixed with module name to avoid nameclashes.
  • Text module textareas are now a separate field type so the db schema won't change.
  • Text module format columns are always set and don't change by field settings so the db schema won't change.
  • Text and Number with allowed values are now made into List field types.
  • Default values are moved out of the field settings into the field_ui_field_settings table (TODO: revisit this)
  • variable : cck_extra_weights_% => field_extra_weights_%
  • permission: "Use PHP input for field settings (dangerous - grant with care)" => "use PHP input for field settings"