summaryrefslogtreecommitdiff
path: root/modules/field_ui/field_ui.api.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-09-26 15:57:39 +0000
committerDries Buytaert <dries@buytaert.net>2009-09-26 15:57:39 +0000
commitdb09a6178ba423fe2ce85317afaca5c58a5b6887 (patch)
tree7a23bc57bfb65197a9ac1416d8c989b506e5e05d /modules/field_ui/field_ui.api.php
parentdba2ebb118a25ff6ed9bcc6a59cc42c20d55ad66 (diff)
downloadbrdo-db09a6178ba423fe2ce85317afaca5c58a5b6887.tar.gz
brdo-db09a6178ba423fe2ce85317afaca5c58a5b6887.tar.bz2
- Patch #367013 by bjaspan, KarenS | yched, Dries: add support for field updates.
Diffstat (limited to 'modules/field_ui/field_ui.api.php')
-rw-r--r--modules/field_ui/field_ui.api.php15
1 files changed, 14 insertions, 1 deletions
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',