diff options
Diffstat (limited to 'modules/image/image.install')
-rw-r--r-- | modules/image/image.install | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/modules/image/image.install b/modules/image/image.install index 4edc32003..516555829 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' => 512, 'not null' => FALSE, ), 'title' => array( 'description' => "Image title text, for the image's 'title' attribute.", 'type' => 'varchar', - 'length' => 128, + 'length' => 1024, 'not null' => FALSE, ), 'width' => array( @@ -395,6 +395,42 @@ function image_update_7003() { } /** + * Use a large setting (512 and 1024 characters) for the length of the image alt + * and title fields. + */ +function image_update_7004() { + $alt_spec = array( + 'type' => 'varchar', + 'length' => 512, + 'not null' => FALSE, + ); + + $title_spec = array( + 'type' => 'varchar', + '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) { + $tables = array( + _field_sql_storage_tablename($field), + _field_sql_storage_revision_tablename($field), + ); + $alt_column = $field['field_name'] . '_alt'; + $title_column = $field['field_name'] . '_title'; + foreach ($tables as $table) { + db_change_field($table, $alt_column, $alt_column, $alt_spec); + db_change_field($table, $title_column, $title_column, $title_spec); + } + } +} + +/** * Implements hook_requirements() to check the PHP GD Library. * * @param $phase |