Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only date('format') filter in Summary String Transformations work. All others are broken. #7221

Closed
mimecine opened this issue May 30, 2024 · 4 comments · Fixed by #7313
Closed
Labels
type: bug code to address defects in shipped code

Comments

@mimecine
Copy link

Describe the bug

The only filter that seems to work in the summary is the date one. All others are inert.

To Reproduce
summary = "{{ title | upper }} / {{ title | lower }} / {{ title | truncate(3) }} / {{ nonexistant | default('Hello') }} / {{mytruth | ternary('Yep','Nope') }} / {{today | date('yyyy') }}" yields
Title / Title / Title / / / 2024
Booleans don't display at all whether true or false (might be expected tho)

Expected behavior
TITLE / title / Tit / Hello / Yep / 2024

Applicable Versions:

  • Decap CMS version: 4.3.0
  • Git provider: Github
  • OS: MacOS latest
  • Browser version: Chrome latest

Additional context
Booleans don't display at all whether true or false (might be expected tho)

@mimecine mimecine added the type: bug code to address defects in shipped code label May 30, 2024
@mimecine
Copy link
Author

With further investigation, I realize that it's a matter of spaces, but only if it's written like {{var | filter}} not as {{var | filter }} <- note the space at the end.

The ternary filter is sensitive about spacing before an argument.

Chaining filters doesn't work.

@Tarun1406
Copy link

Hi,
is someone is working on it or should I take it.

@martinjagodic
Copy link
Member

@Tarun1406 are you working on this?

@Tarun1406
Copy link

Tarun1406 commented Oct 17, 2024 via email

hip3r added a commit to poslovnimediji/decap-cms that referenced this issue Oct 24, 2024
demshy added a commit that referenced this issue Nov 12, 2024
* fix: summary string transformations format (#7221)

* fix: broken tests fix

* refactor: summary string transformations code to pattern

---------

Co-authored-by: Anze Demsar <anze.demsar@p-m.si>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants