Remove tokens from labels if a replacement value cannot be generated

Created on 8 January 2024, 6 months ago
Updated 9 February 2024, 4 months ago

Problem/Motivation

When a token that is configured as part of a pattern cannot be replaced, the token is shown as part of the label

Steps to reproduce

  1. Add a custom field to users that is not required.
  2. Include that field as part of a pattern, for example, [user:account-name] - [user:field_full_name].
  3. The text "[user:field_full_name]" will be displayed on the labels of users who do not have a configured a full name.

Proposed resolution

Replace field tokens by empty strings when there is no field value by setting the clear option on every Token::replace() call

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡·Argentina matias

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024