As I understand it, the [save-lineage-termpath-raw] token will need changing to fit with the current dev versions of pathauto and token. Apologies if I have misunderstood the issue.

See #881270: [bookpath], [menupath], [*path] tokens not cleaned: aliases without punctuation removed, lower casing, etc.

CommentFileSizeAuthor
#5 931902-hs-path-tokens-array.patch2.17 KBDave Reid
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tayzlor’s picture

I have also noticed that the [save-lineage-termpath-raw] tokens have gone missing / broken since updating pathauto and token. Will look into these issues and try work on a patch if i have time.

Shadlington’s picture

According to #142 in that issue, it is fairly straightforward to fix.

Shadlington’s picture

FYI - This is now in the latest releases of Token and Pathauto (6.x-1.15 and 6.x-1.5), not just the dev versions.

Dave Reid’s picture

Issue tags: +token, +pathauto

Tagging.

Also see http://drupal.org/node/936068 which is the new handbook page on creating path-style tokens.

Dave Reid’s picture

Status: Active » Needs review
FileSize
2.17 KB

Untested patch against 3.x.

Dave Reid’s picture

Marked #953392: save-lineage-termpath token not lowercased as a duplicate of this issue.

root66’s picture

#5 Patch works for me (lowercase problem solved)!

root66’s picture

There's a new problem, my save-lineage-termpath token is always empty now, because the $terms array is never filled:

// hs_taxonomy_token_values function

print_r($all_vids);
print_r($hs_vids);
print_r($node->taxonomy);

      foreach ($all_vids as $vid) {
        $terms = array();
        if (in_array($vid, $hs_vids) && isset($node->taxonomy[$vid])) {
          $selection = $node->taxonomy[$vid];
          $terms = _hs_taxonomy_token_termpath_for_vid($selection, $vid);
        }

The print_r's return:

Array
(
[0] => 1
[1] => 2
)

Array
(
[0] => 1
)

Array
(
[19] => stdClass Object
(
[tid] => 19
[vid] => 1
[name] => Test
[description] =>
[weight] => 0
)

[20] => stdClass Object
(
[tid] => 20
[vid] => 1
[name] => Test2
[description] =>
[weight] => 0
)
)

There are the vocabularies 1 and 2. 1 is selected for "HS" and the node has two terms assigned.

The problem is that you check if the $vid is set in $node->taxonomy (isset($node->taxonomy[$vid])), but the $node->taxanomy array uses the term id (tid) as key only, not the vocabulary id.

It worked before, because I had terms with the same tid, as the vid.

Wim Leers’s picture

Title: Token will need updating following changes to token and pathauto » Update Token integration to support recent versions of Token
Assigned: Unassigned » Wim Leers
Status: Needs review » Fixed

Thanks, Dave! I fixed some more issues with my implementation (wow that was working poorly, I must've committed some patches without proper review). Now it's working nicely :)

http://drupal.org/cvs?commit=495058

Status: Fixed » Closed (fixed)

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

roderik’s picture

...except [save-lineage-termpath:vid] tokens aren't working for Pathauto.

For the search engines: see #1137056: Pathauto >= 1.4 admin screen disallows [save-lineage-termpath-raw:vid] token