Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 296561

[node:summary] token's value get trimmed incorrectly

$
0
0

Problem/Motivation

When no summary is specified, token [node:summary] uses formatter settings of teaser view mode in order to generate trimmed version of body field. If 'teaser' view mode is not configured, default text_summary_or_trimmed trim lengths will be used (600 characters atm)

However, existing code does not check what formatter is being used. Instead, it checks for trim_length setting only.

When some other field formatter (like Smart trim) is being used for teasers, summary is being generated incorrectly. This happens because Smart trim uses exactly the same trim_length setting, but it can be words, not characters.

In particular case, smart trim is configured to use 30 words. Token [node:summary] gives 30 characters, instead of default 600.

Proposed resolution

Add extra check for the formatter that is being used for teaser view mode for body field.

Remaining tasks

  • Review patch

User interface changes

No

API changes

No

Data model changes

No


Viewing all articles
Browse latest Browse all 296561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>