diff --git a/core/modules/node/node.tokens.inc b/core/modules/node/node.tokens.inc index 2d783c9..c47c3ee 100644 --- a/core/modules/node/node.tokens.inc +++ b/core/modules/node/node.tokens.inc @@ -148,8 +148,15 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr $output = $sanitize ? _text_sanitize($instance, $field_langcode, $items[0], 'value') : $items[0]['value']; // A summary was requested. if ($name == 'summary') { + if (isset($instance['display']['teaser']['settings']['trim_length'])) { + $trim_length = $instance['display']['teaser']['settings']['trim_length']; + } + else { + // Use default value. + $trim_length = NULL; + } // Generate an optionally trimmed summary of the body field. - $output = text_summary($output, $instance['settings']['text_processing'] ? $items[0]['format'] : NULL, $instance['display']['teaser']['settings']['trim_length']); + $output = text_summary($output, $instance['settings']['text_processing'] ? $items[0]['format'] : NULL, $trim_length); } } $replacements[$original] = $output;