After upgrading to 6.x-2.0, I'm seeing an error for a duplicate token. Wasn't sure if this needed to be filed as a bug report, so I've left it support request for now:

The following tokens are defined by multiple modules and may cause problems when performing token replacement.
node:flag-bookmarks-link (defined by modules: activity_log, flag)

Comments

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

Does that module define flags?

t-readyroc’s picture

Status: Postponed (maintainer needs more info) » Active

I'm not positive.

From the module page:

and you can use the Flag module to add "like" buttons to content in the stream.

I don't see anything on it in its documentation.

joachim’s picture

Can you look in the code?

joachim’s picture

Status: Active » Postponed (maintainer needs more info)
t-readyroc’s picture

Status: Postponed (maintainer needs more info) » Active

I'll start with: I'm not a programmer (but I did sleep at a Holiday Inn Express last night).

But looking at the code, it looks like activity_log doesn't define flags; it only calls the flag module. It will return set flags as both arrays and SQL queries.

Here's perhaps some relevant code (from activity_log.module):

//====================
// TOKEN INTEGRATION.
//====================

// TODO: Remove the flag tokens after http://drupal.org/node/1202648 lands.

/**
 * Implementation of hook_token_list().
 */
function activity_log_token_list($type = 'all') {
  $tokens = array();
  if (module_exists('flag')) {
    foreach (flag_get_types() as $flag_type) {
      if ($type == $flag_type || $type == 'all') {
        $flags = flag_get_flags($flag_type);
        foreach ($flags as $flag) {
          $tokens[$flag_type]['flag-'. str_replace('_', '-', $flag->name) .'-link'] = t('(Un)flag link for the "@flag" flag.', array('@flag' => $flag->get_title()));
        }
      }
    }
  }
/**
 * Implementation of hook_token_values().
 */
function activity_log_token_values($type, $object = NULL, $options = array()) {
  $values = array();
  if (module_exists('flag')) {
    if (in_array($type, flag_get_types())) {
      $flags = flag_get_flags($type);
      foreach ($flags as $flag) {
        $values['flag-'. str_replace('_', '-', $flag->name) .'-link'] = flag_create_link($flag->name, $flag->get_content_id($object));
      }
    }
  }

Many, many more lines of code referring to flags in 3 other files as well; but nothing that looks like a declaration/definition.

joachim’s picture

Title: token conflict with activity log » flag token conflict with flag
Project: Flag » Activity Log
Version: 6.x-2.0 » 6.x-2.x-dev
Component: Token integration » Code
Category: support » bug

Ok so it looks like Activity log is trying to do our work for us.

icecreamyou’s picture

Status: Active » Fixed

Activity Log was designed with Flag 1.x in mind and I have no idea if it works with Flag 2.x. However, I just committed a fix to dev that should at least avoid the problem brought up in this issue.

Status: Fixed » Closed (fixed)

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