Make token clear option configurable

Created on 2 February 2024, 10 months ago
Updated 21 February 2024, 9 months ago

Problem/Motivation

In #3381449 🐛 Plain text fields with tokens are rendered as markup leads to double-escaping characters Fixed the ['clear' => TRUE] option is hardcoded. This introduces a bug with custom filters formatted like tokens, so making this option configurable (disabled by default, like the token_filter module) is desired.

Feature request
Status

Fixed

Version

9.1

Component

Module Core

Created by

🇺🇸United States firewaller

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

Merge Requests

Comments & Activities

  • Issue created by @firewaller
  • Merge request !101Make token clear option configurable → (Merged) created by firewaller
  • Pipeline finished with Failed
    10 months ago
    Total: 389s
    #86960
  • Pipeline finished with Failed
    10 months ago
    Total: 347s
    #86968
  • Pipeline finished with Failed
    10 months ago
    Total: 361s
    #86973
  • 🇺🇸United States firewaller

    Patch attached for 9.1.0-beta8. This excludes the hook_update to prevent conflicts with future hook updates. Please run drush cset patternkit.settings patternkit_json_editor_token_clear false -y when using this specific patch.

  • 🇺🇸United States slucero Arkansas

    slucero changed the visibility of the branch 9.1.x to hidden.

  • 🇺🇸United States slucero Arkansas

    slucero changed the visibility of the branch 9.1.x to active.

  • 🇺🇸United States slucero Arkansas
  • Status changed to Needs review 10 months ago
  • 🇺🇸United States slucero Arkansas

    slucero changed the visibility of the branch 3418973-make-token-clear to hidden.

  • 🇮🇳India minsharm India

    Retested the issue and result looks good to me.

    Results:

    • Valid tokens with a provided context were replaced as expected
    • An invalid token was removed only when "Replace empty token values" checkbox is checked
    • Non-token text in square brackets was unaffected

    My test content:

    My content with a valid token: [node:title]<br/>
    My content with an invalid token: [node:something]<br/>
    My referenced text with square brackets: [non-token content]<br/>

    Output

    Case 1 : Check the "Replace empty token values" checkbox

    My content with a valid token: Patternkit Page<br/>
    My content with an invalid token: <br/>
    My referenced text with square brackets: [non-token content]<br/>

    Case 2 : Uncheck the "Replace empty token values" checkbox

    My content with a valid token: Patternkit Page<br/> 
    My content with an invalid token: [node:something]<br/> 
    My referenced text with square brackets: [non-token content]<br/>
  • Status changed to RTBC 10 months ago
  • 🇺🇸United States slucero Arkansas
  • Pipeline finished with Skipped
    10 months ago
    #89777
  • Status changed to Fixed 10 months ago
  • 🇺🇸United States slucero Arkansas

    Merged for inclusion in the beta 9 release.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024