When i put a field token ( [node:field_X] ) and field_X is null, it is not replaced, and i see the token on the output. I would like the token to be replaced with an empty string?

The way it works now, is a feature? It is a bug?

Comments

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

It depends on the module that is calling the token replacement to use $options['clear'] = TRUE. What module are you using to output the tokens?

Anonymous’s picture

Oh thanks! It is my very own module. Thanks for the support (btw, where is that documented?)

dave reid’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ah glad to hear it. This is documented in the core function token_replace(): "clear: A boolean flag indicating that tokens should be removed from the final text if no replacement value can be generated". Glad to have solved it for you!

Status: Fixed » Closed (fixed)

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