Tokens causing incorrect text substitutions I'm running Drupal 7 on Ubuntu 14.04 server, core and all modules up to date as of today (7th May). We have noticed today that zeros (0) are not displaying correctly in blocks that have a custom token. They are being substituted for the word 'custom'.

For example, "7,500" displays as "7,5customcustom".

I'm not sure how long it has been doing this, as we have only just noticed it today. In blocks without Custom Tokens, the zeros display correctly. This is a relatively recent issue, as it was not a problem a couple of months ago when our site was reviewed by our solicitors.

The source for the content is correct - so it appears to be a display issue. Any ideas?

As an aside, the zeros being replaced need not be in the Custom Token to be replaced (it happens whether they are part of the Custom Token, and when they are just plain text on the page).
It appears to me that the explanation for your issue might be because of any of the following reasons

Reason 1:

It could be related to what is described in  https://www.drupal.org/node/390482, which states:


  The tokens available depends on what modules you have enabled on your Drupal site.


So could it be that you (accidently) disabled a module recently, which was actually the module related to the token that you now have an issue with?

Also, some more related considerations, based on what I read at comment #3 in the issue queue on D.O:


What does that "00" in the "7,500" actually refer to? I want to better understand which module(s) are related to it.
What result do you get if you (temporary) enable all of your currently disabled modules? FYI: if you only enabled the module that is causing this issue, and not uninstalled it, the problem might be resolved, at least for now. And then you can think of how to best resolved it permanently.


Reason 2:

When you define a custom token, for "Text format" (under the "Content" box): verify what the text format is you use there. And also verify what the text format is of where you are trying to USE that custom token (as in the original question: in the block), or in your Webform, Email etc.

Because maybe something is wrong in the way you're using/mixing text formats. Refer to How to use the Custom Tokens module, especially to this part of it (bold markup added here):


  note that "Custom Token" sends what you put in the "Content" box to the page. It doesn't evaluate it first and then send it. Therefore, if your custom tokens include other tokens and/or PHP code, then the "Body" box in which you place your tokens must use the same text format that you used to define them, so that the other tokens and/or PHP get evaluated.


The question here might be a minor variation of the scenario described in that community page ...

Other reasons worth verifying:


Maybe the field "type" got changed somehow, and that is what's causing it?
Something similar within the content type settings?
Could it be related to something about some missing "permissions" (for those cases where there is this issue)?


Curious to hear if either of these 2 reasons are actually also a solution for what this question is about.