I was using the latest dev over the weekend and noticed you added support for multiple path aliases. Thank you very much. Hopefully the code that scottrigby provided helped out. After updating to the latest recommended version I'm now seeing this message in my status report.

"Duplicate tokens: The following tokens are defined by multiple modules and may cause problems when performing token replacement."

The list of tokens is pretty long. It seems like its listing all the node and cck tokens.

CommentFileSizeAuthor
tokens.png42.82 KBgooddesignusa

Comments

wojtha’s picture

Assigned: Unassigned » wojtha
Category: task » bug
Priority: Normal » Minor

Hmm I see. I'm loading node token values to nodesymlinks to be available at pathauto configuration.

I think we could change it to "minor bug" as it is conflict with some token validation check.

ccoppen’s picture

Just to note that I'm having the same issue. I think it's also causing a date field to fail, but I have yet to confirm this. Still troubleshooting that issue. The date problem didn't happen until this started happening.

gooddesignusa’s picture

I dont understand how this exactly works but I'm curious why the nodesymlink needs an area in pathauto and why it can't just use what is already set in pathauto for that node type. I'm using the date field on the site that has this issue and I haven't noticed any issues. But than again i'm not using tokens for anything other than pathauto.

amilne’s picture

Same issue after upgrading this morning. Will update with more details if I can find any "broken" areas of the site.

KHofmeyer’s picture

Same issue here with tokens, subscribing.

dave reid’s picture

Priority: Minor » Normal

Problem is the following which just seems unnecessary since they aren't replaced in hook_token_values() anyway.

    $tokens += token_get_list('node');
wojtha’s picture

Status: Active » Needs work

@Dave Reid: you are wrong, node tokens are replaced ... but it isn't handled by nodesymlinks module but in the tokens module hook_token_values() implementation. I'm using it in nodesymlinks_pathauto_create_alias() - see below. I know it is dirty way, but I didn't find better way how to use other entities tokens inside the nodesymlinks pattern...

function nodesymlinks_pathauto_create_alias($item, $node, $op = 'return') {
    // ...
    $data_object['node'] = $node;
    $node_placeholders = pathauto_get_placeholders('node', $node); // <---- HERE
    $placeholders = pathauto_get_placeholders('nodesymlinks', $data_object);
    $placeholders['values'] += $node_placeholders['values'];
    nodesymlinks_reconstruct_tokens($placeholders);
    // ...
    $pathauto_alias = pathauto_create_alias('nodesymlinks', $op, $placeholders, $source, $entity_id, $type, $language);
    // ...
}

However from 6.x-1.0-beta4 release is now this feature optional so you can enable/disable Node tokens support for Nodesymlinks pattern definition in the module's settings if you don't need it.

I'm leaving this issue active as the current 'fix' is not real fix - it is only workaround - and I'm interested also in a way how to use tokens defined by other entities (Node, CCK) in the nodesymlinks pattern properly.

wojtha’s picture

I think I have it... I removed nodesymlinks node tokens from 'all' namespace...

    // Access also node tokens
    if (variable_get('nodesymlinks_node_tokens', 0) && $type == 'nodesymlinks') {
      $tokens += token_get_list('node');
    }

It will be included in 6.x-1.0-beta5 release.

wojtha’s picture

Status: Needs work » Fixed

Fixed in 6.x-1.0-beta5.

Status: Fixed » Closed (fixed)

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