From db09a6178ba423fe2ce85317afaca5c58a5b6887 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 26 Sep 2009 15:57:39 +0000 Subject: - Patch #367013 by bjaspan, KarenS | yched, Dries: add support for field updates. --- modules/field_ui/field_ui.api.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'modules/field_ui/field_ui.api.php') diff --git a/modules/field_ui/field_ui.api.php b/modules/field_ui/field_ui.api.php index 9a938fae9..9442d94eb 100644 --- a/modules/field_ui/field_ui.api.php +++ b/modules/field_ui/field_ui.api.php @@ -14,14 +14,27 @@ /** * Field settings form. * + * The field type module is responsible for not returning form elements that + * cannot be changed. It may not always be possible to tell in advance, but + * modules should attempt to inform the user what is going/likely to work. + * + * @todo: Only the field type module knows which settings will affect the + * field's schema, but only the field storage module knows what schema + * changes are permitted once a field already has data. Probably we need an + * easy way for a field type module to ask whether an update to a new schema + * will be allowed without having to build up a fake $prior_field structure + * for hook_field_update_forbid(). + * * @param $field * The field structure being configured. * @param $instance * The instance structure being configured. + * @param $has_data + * Whether the field already has data. * @return * The form definition for the field settings. */ -function hook_field_settings_form($field, $instance) { +function hook_field_settings_form($field, $instance, $has_data) { $settings = $field['settings']; $form['max_length'] = array( '#type' => 'textfield', -- cgit v1.2.3