hi anybody
thanks to the maintainers for your great work for this cool module!
my problem:
if i add tokens of fields which are not present in all node-types, linkit shows the token-code in the auto-suggest area instead of hiding it. this makes the auto-suggest area quite ugly. can anybody give a hint how to avoid these tokens to be shown?
any help is greatly appreciated!

Comments

anon’s picture

Hi.

I havent really thought about this, but it seems like you are right.

Just remove the "tokens" in the text is not a solutuion I think, as there can be text that looks like tokens, but is just text.

I will have to think about this issue.

anon’s picture

Category: bug » task
anon’s picture

Assigned: indyaner » Unassigned
anon’s picture

Status: Active » Fixed
$description = preg_replace('/\[[^\s\[\]:]*:[^\s\[\]]*\]/x', '', $description);

That will remove all tokens that isnt replaced.

Fix commited to 2.x and 3.x

anon’s picture

Status: Fixed » Active

I found a better solution:

token_replace can take options.

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

anon’s picture

Status: Active » Fixed

Fixed with the solution from #5

Status: Fixed » Closed (fixed)

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