diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc index 43e118a..ee1d186 100644 --- a/modules/image/image.field.inc +++ b/modules/image/image.field.inc @@ -358,7 +358,7 @@ function image_field_widget_process($element, &$form_state, $form) { '#type' => 'textfield', '#default_value' => isset($item['alt']) ? $item['alt'] : '', '#description' => t('This text will be used by screen readers, search engines, or when the image cannot be loaded.'), - '#maxlength' => variable_get('image_alt_length', 80), // See http://www.gawds.org/show.php?contentid=28. + '#maxlength' => variable_get('image_alt_length', 1024), // See http://www.gawds.org/show.php?contentid=28. '#weight' => -2, '#access' => (bool) $item['fid'] && $settings['alt_field'], ); @@ -367,7 +367,7 @@ function image_field_widget_process($element, &$form_state, $form) { '#title' => t('Title'), '#default_value' => isset($item['title']) ? $item['title'] : '', '#description' => t('The title is used as a tool tip when the user hovers the mouse over the image.'), - '#maxlength' => variable_get('image_title_length', 500), + '#maxlength' => variable_get('image_title_length', 1024), '#weight' => -1, '#access' => (bool) $item['fid'] && $settings['title_field'], ); diff --git a/modules/image/image.install b/modules/image/image.install index 6f37ad0..77c7e87 100644 --- a/modules/image/image.install +++ b/modules/image/image.install @@ -121,13 +121,13 @@ function image_field_schema($field) { 'alt' => array( 'description' => "Alternative image text, for the image's 'alt' attribute.", 'type' => 'varchar', - 'length' => 128, + 'length' => variable_get('image_alt_length', 1024), 'not null' => FALSE, ), 'title' => array( 'description' => "Image title text, for the image's 'title' attribute.", 'type' => 'varchar', - 'length' => 128, + 'length' => variable_get('image_title_length', 1024), 'not null' => FALSE, ), ), @@ -144,6 +144,44 @@ function image_field_schema($field) { } /** + * Use a large setting (1024 characters) for the length of the image alt + * and title fields. + */ +function image_update_8000() { + $alt_spec = array( + 'type' => 'varchar', + 'length' => variable_get('image_alt_length', 1024), + 'not null' => FALSE, + ); + $title_spec = array( + 'type' => 'varchar', + 'length' => variable_get('image_title_length', 1024), + 'not null' => FALSE, + ); + $fields = _update_7000_field_read_fields(array( + 'module' => 'image', + 'storage_type' => 'field_sql_storage', + )); + foreach ($fields as $field_name => $field) { + if ($field['deleted']) { + $table = "field_deleted_data_{$field['id']}"; + $revision_table = "field_deleted_revision_{$field['id']}"; + } + else { + $table = "field_data_{$field['field_name']}"; + $revision_table = "field_revision_{$field['field_name']}"; + } + $alt_column = $field['field_name'] . '_' . 'alt'; + db_change_field($table, $alt_column, $alt_column, $alt_spec); + db_change_field($revision_table, $alt_column, $alt_column, $alt_spec); + + $title_column = $field['field_name'] . '_' . 'title'; + db_change_field($table, $title_column, $title_column, $title_spec); + db_change_field($revision_table, $title_column, $title_column, $title_spec); + } +} + +/** * Implements hook_requirements() to check the PHP GD Library. * * @param $phase