Because thee field settings are stored as variables, they do not get included with exported cck fields when using features to export a content type.

Rather than using hook_form_alter and storing the settings in variables, you should instead hook into the cck field using hook_widget_settings_alter(). Take a loot at the insert module for a good example of how to do this.

This will ensure that all the settings for each cck field can be properly encapsulated with the field, and included on any exports.

CommentFileSizeAuthor
#1 654730-imagecrop-cck-widget.patch17.91 KBmrfelton

Comments

mrfelton’s picture

Title: CCK field settings should be stored with the cck field by using hook_widget_settings_alter() » Per widget settings - (store field settings with cck field data - allows support for features export)
Status: Active » Needs review
StatusFileSize
new17.91 KB

Attached patch reworks things so that proper cck hooks are used to alter the widget. This gives you:

  • per widget settings (rather than global settings for each field)
  • widget settings are stored with widget, rather than in standalone system variables
  • caters for cck field exports using features module (because data is stored in the cck way)
  • less system variables clogging up the system table
  • uses imagecache api functions for retrieving list of available presets (rather than direct database calls). This ensure that imagecache presets that are stored in code are also available for use.
mrfelton’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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