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

Created on 22 February 2017, over 7 years ago
Updated 21 May 2024, about 1 month ago

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

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
TokenΒ  β†’

Last updated 5 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡¦Ukraine Andrew147

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do

    What I would add is that trim_length is not exposed as an option if not using either trimmed or summary and trimmed setting.

  • Pipeline finished with Success
    about 1 month ago
    Total: 577s
    #178500
  • Pipeline finished with Failed
    about 1 month ago
    Total: 344s
    #178550
  • Pipeline finished with Failed
    about 1 month ago
    Total: 317s
    #178566
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 292s
    #178573
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 75s
    #178578
  • Pipeline finished with Failed
    about 1 month ago
    Total: 162s
    #178579
  • Pipeline finished with Failed
    about 1 month ago
    Total: 610s
    #178582
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 117s
    #178597
  • Pipeline finished with Failed
    about 1 month ago
    Total: 525s
    #178599
  • Pipeline finished with Failed
    about 1 month ago
    Total: 550s
    #178615
  • Pipeline finished with Failed
    about 1 month ago
    Total: 513s
    #178620
Production build 0.69.0 2024