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

jasontanner’s picture

Ok, 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:

[location-city_N]
    City (If there are multiple locations per node, N is the iteration, starting with 0)
[location-province_N]
    State/Province (If there are multiple locations per node, N is the iteration, starting with 0)
[location-province_name_N]
    State/Province Name (If there are multiple locations per node, N is the iteration, starting with 0)
[location-postal_code_N]
    Postal Code (If there are multiple locations per node, N is the iteration, starting with 0)
...
[location-country_N]
    Country (If there are multiple locations per node, N is the iteration, starting with 0)
[location-country_name_N]

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

jasontanner’s picture

Title: Location Tokens Broken ? » Location Tokens & Location CCK & PathAuto ?

Ok, 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.

jasontanner’s picture

Ok, 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 ?

jasontanner’s picture

Is this working for anyone else ? e.g. Using location with cck fields and path auto ?

jasontanner’s picture

Title: Location Tokens & Location CCK & PathAuto ? » Location CCK: Missing function location_cck_token_list & location_cck_token_values
Priority: Normal » Critical

Ok, 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.

jasontanner’s picture

bdragon’s picture

Assigned: Unassigned » bdragon

Yeah, good point. It's location_cck's responsibility to provide the tokens.

bdragon’s picture

Status: Active » Fixed

Implemented. 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

jasontanner’s picture

Thank 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. :)

Status: Fixed » Closed (fixed)

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

vthirteen’s picture

Status: Closed (fixed) » Active

i'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 ]

YesCT’s picture

Version: 6.x-3.x-dev » 6.x-3.1-rc1

Since 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. :)

tateenglund’s picture

Version: 6.x-3.1-rc1 » 7.x-3.x-dev
Status: Active » Closed (fixed)

I am having this issue still. Are there any work arounds.