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 19 Apr 2010 23:19:05 -0000 @@ -249,6 +249,7 @@ function text_field_formatter_info() { 'text_trimmed' => array( 'label' => t('Trimmed'), 'field types' => array('text', 'text_long', 'text_with_summary'), + 'settings' => array('summary_length' => 600), ), // The 'summary or trimmed' field formatter for text_with_summary @@ -258,6 +259,7 @@ function text_field_formatter_info() { 'text_summary_or_trimmed' => array( 'label' => t('Summary or trimmed'), 'field types' => array('text_with_summary'), + 'settings' => array('summary_length' => 600), ), ); } @@ -274,7 +276,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 = $display['settings']['summary_length']; + $output = text_summary($output, $instance['settings']['text_processing'] ? $item['format'] : NULL, $size); } $element[$delta] = array('#markup' => $output); } @@ -287,7 +290,7 @@ function text_field_formatter_view($enti } else { $output = _text_sanitize($instance, $langcode, $item, 'value'); - $size = variable_get('teaser_length_' . $instance['bundle'], 600); + $size = $display['settings']['summary_length']; $output = text_summary($output, $instance['settings']['text_processing'] ? $item['format'] : NULL, $size); } $element[$delta] = array('#markup' => $output); Index: modules/node/node.test =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.test,v retrieving revision 1.79 diff -u -p -r1.79 node.test --- modules/node/node.test 13 Apr 2010 23:16:56 -0000 1.79 +++ modules/node/node.test 19 Apr 2010 23:19:05 -0000 @@ -566,6 +566,26 @@ class SummaryLengthTestCase extends Drup $this->assertRaw($expected, t('Check that the summary is 600 characters in length'), 'Node'); // Edit the teaser length for "Basic page" content type + $instance = array( + 'entity_type' => 'node', + 'field_name' => 'body', + 'bundle' => 'page', + 'display' => array( + 'full' => array( + 'label' => 'hidden', + 'type' => 'text_default', + ), + 'teaser' => array( + 'label' => 'hidden', + 'type' => 'text_summary_or_trimmed', + 'settings' => array( + 'summary_length' => 200, + ), + ), + ), + ); + field_update_instance($instance); + $edit = array ( 'teaser_length' => 200, );