Index: modules/field/modules/text/text.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.module,v retrieving revision 1.53 diff -u -p -r1.53 text.module --- modules/field/modules/text/text.module 13 Apr 2010 15:16:27 -0000 1.53 +++ modules/field/modules/text/text.module 15 Apr 2010 13:18:00 -0000 @@ -36,7 +36,7 @@ function text_field_info() { 'label' => t('Text'), 'description' => t('This field stores varchar text in the database.'), 'settings' => array('max_length' => 255), - 'instance_settings' => array('text_processing' => 0), + 'instance_settings' => array('text_processing' => 0, 'summary_length' => 600), 'default_widget' => 'text_textfield', 'default_formatter' => 'text_default', ), @@ -44,7 +44,7 @@ function text_field_info() { 'label' => t('Long text'), 'description' => t('This field stores long text in the database.'), 'settings' => array('max_length' => ''), - 'instance_settings' => array('text_processing' => 0), + 'instance_settings' => array('text_processing' => 0, 'summary_length' => 600), 'default_widget' => 'text_textarea', 'default_formatter' => 'text_default', ), @@ -52,7 +52,7 @@ function text_field_info() { 'label' => t('Long text and summary'), 'description' => t('This field stores long text in the database along with optional summary text.'), 'settings' => array('max_length' => ''), - 'instance_settings' => array('text_processing' => 1, 'display_summary' => 0), + 'instance_settings' => array('text_processing' => 1, 'display_summary' => 0, 'summary_length' => 600), 'default_widget' => 'text_textarea_with_summary', 'default_formatter' => 'text_summary_or_trimmed', ), @@ -274,7 +274,8 @@ function text_field_formatter_view($enti foreach ($items as $delta => $item) { $output = _text_sanitize($instance, $langcode, $item, 'value'); if ($display['type'] == 'text_trimmed') { - $output = text_summary($output, $instance['settings']['text_processing'] ? $item['format'] : NULL); + $size = $instance['settings']['summary_length']; + $output = text_summary($output, $instance['settings']['text_processing'] ? $item['format'] : NULL, $size); } $element[$delta] = array('#markup' => $output); } @@ -287,7 +288,7 @@ function text_field_formatter_view($enti } else { $output = _text_sanitize($instance, $langcode, $item, 'value'); - $size = variable_get('teaser_length_' . $instance['bundle'], 600); + $size = $instance['settings']['summary_length']; $output = text_summary($output, $instance['settings']['text_processing'] ? $item['format'] : NULL, $size); } $element[$delta] = array('#markup' => $output);