Allow admin configuration to remove tokens if no replacement value can be generated

Created on 3 September 2014, over 10 years ago
Updated 16 January 2025, 3 months ago

When using this module to create a filter, if data field is NULL, it's rendered with un-parsed token.

Problem:
By default the module TokenFilter calls function token_replace in function _token_filter_filter_tokens . If a token does not contain a replacement value, the token name is still spat out in the field.

Solution:
token_replace is defined as token_replace($text, array $data = array(), array $options = array()).
In the options aray, there is a 'clear' option which is

"A boolean flag indicating that tokens should be removed from the final text if no replacement value can be generated."

.

We need to provide an Option that allow admin who is configuration an "filter" is enable this or not.

Feature request
Status

Closed: outdated

Version

1.1

Component

Code

Created by

🇻🇳Vietnam zkday

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

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024