Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm using the latest dev versions of Location (6.x.3.x-dev) and Pathauto (6.x-2.x-dev) and Token (6.x-1.x-dev) as of this date but no matter how I try to regenerate the aliases they always end up being like this:
drupal6/business/[location-country_0]/[location-province_name_0]/[location-city_0]/eagle
Comments
Comment #1
jasontanner CreditAttribution: jasontanner commentedOk, I downgraded to the non-dev versions of Pathauto (6.x-1.1) and Token (6.x-1.11), then deleted all the aliases in the system and regenerated them and still the location tokens aren't populating. Since, other tokens in the path are populated I'm assuming the problem is not with the Token or Pathauto modules.
According to the Pathauto management screens the correct replacement tokens from the location module are:
My replacement pattern is:
business/[location-country_name_0]/[location-province_name_0]/[location-city_0]/[title-raw]
I know this used to work but as I'd not checked recently I can't be sure when it staretd to fail. I've even tried the patch that someone provided in a similar thread that related just to country but that made no difference to the outcome:
drupal6/business/[location-country_0]/[location-province_name_0]/[location-city_0]/eagle
Comment #2
jasontanner CreditAttribution: jasontanner commentedOk, I put some debug into the location.tokens.inc file and realised that my locations object was empty. I'm assuming this is because for that nodetype I had chosen to use CCK and not the default location input mechanism.
I'll do some digging to see how I can use the cck location values as tokens instead - assuming that is possible.
Comment #3
jasontanner CreditAttribution: jasontanner commentedOk, on the face of it there does not yet seem to be any support for using location info thats stored using cck as a token.
@Bdragon, can you confirm this ?
Comment #4
jasontanner CreditAttribution: jasontanner commentedIs this working for anyone else ? e.g. Using location with cck fields and path auto ?
Comment #5
jasontanner CreditAttribution: jasontanner commentedOk, after digging around in the code it looks like the location_cck module is missing hook functions for:
hook_token_list (i.e. location_cck_token_list)
hook_token_values (i.e. location_cck_token_values )
These hook functions are called by the CCK field token implementation.
Comment #6
jasontanner CreditAttribution: jasontanner commentedComment #7
bdragon CreditAttribution: bdragon commentedYeah, good point. It's location_cck's responsibility to provide the tokens.
Comment #8
bdragon CreditAttribution: bdragon commentedImplemented. I'm not particularly happy with the code, but it seems to work at least..
http://drupal.org/cvs?commit=169619
http://drupal.org/cvs?commit=169620
Comment #9
jasontanner CreditAttribution: jasontanner commentedThank you. Thank you. Thank you.
I really appreciate this. It's been holding me up for a while and I am very grateful. If you were somewhere near me I'd be delighted to buy you a pint. :)
Comment #11
vthirteen CreditAttribution: vthirteen commentedi've not enabled location CCK but i'm experiencing the same problem. location version 6.x-3.1-rc1.
location replacement patterns are not created and [location-city_N] or [location-province_N] are printed in the url as if the table were not populated (but a city and a province do exist for the node and the map is created properly).
pathauto is working fine, with transliteration but without changing case (replacement token is not altered).
---
[edit: the problem with location tokens is possibly related to this issue: http://drupal.org/node/322328 ]
Comment #12
YesCT CreditAttribution: YesCT commentedSince this thread was about cck locations and it sounds like your trouble is with tokens for (node? Or user?) native locations, specifically with multiple locations (on a node?), you should open a new issue for that. Certainly adding a reference from this issue to that one and from there to here is nice too. :)
Comment #13
tateenglund CreditAttribution: tateenglund commentedI am having this issue still. Are there any work arounds.