If you're using flags with tokens in the label, for example Like ([flag-name-count]), there are times when the front-end messes up the display.

Expected frontend display: Like (12)
Actual display: Like ([flag-name-count])

This brokeness seem related to caching. Because when I flush the Drupal caches, the problem is gone. At least for a while, as it returns intermittently, especially when all Drupal caches are turned on.

I can't explain this, and there's no error messages.

Comments

Anonymous’s picture

Does anybody else have this problem?

quicksketch’s picture

Status: Active » Closed (duplicate)

Same problem here: #1234874: Tokens in flags texts breaks often when Drupal caches enabled. I've already responded to that issue (sorry I saw it first). If you could post any additional information over there that would be helpful in tracking down this problem.

vankod’s picture

Status: Closed (duplicate) » Closed (fixed)

In my case the problem arose from the module realname.

Solution:
In the file realname.module in function realname_user_update add the line realname_update($account);

/**
 * Implements hook_user_update().
 */
function realname_user_update(array &$edit, stdClass $account, $category) {
  // Since user data may have changed, delete the existing realname.
  realname_delete($account->uid);
  realname_update($account); //new line!
}

Voila!