[location-country_N] works with pathauto-6.x-1.1 and token-6.x-1.11

but [location-country_name_N] does not work (gives me %5Blocation-country_name_0%5D).

Comments

ellanylea’s picture

More specifically:

When I go to admin/content/node, and Update path aliases on all my nodes, the paths are correctly set to the country name. Same thing when I delete all aliases and use pathauto's Bulk Update. However, when I edit the node itself at node/16/edit, and click Save, the URL becomes %5Blocation-country_name_0%5D.

ellanylea’s picture

StatusFileSize
new1.08 KB

Found the error. Attached patch generates correct alias in pathauto and imagefield path.

rwohleb’s picture

Status: Active » Needs review

This patch should likely change around the addition of the second line of code. For example:

         $values["location-provincename_$key"] = $values["location-province_name_$key"];
         $values["location-countryname_$key"] = $values["location-country_name_$key"];
+        $values["location-country_name_$key"] = $countries[$values["location-country_$key"]];

should probably be:

+        $values["location-country_name_$key"] = $countries[$values["location-country_$key"]];
         $values["location-provincename_$key"] = $values["location-province_name_$key"];
         $values["location-countryname_$key"] = $values["location-country_name_$key"];
ellanylea’s picture

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

Will you please add the two lines from patch in #2 to location.token.inc to ease the upgrade process and avoid the need to patch every new release of this module.

Many many thanks!

jasontanner’s picture

.

yesct’s picture

Title: location country name token does not work with pathauto » patch to fix location country name token does not work with pathauto
Issue tags: +location compatibility with other modules

could someone re-roll the patch and evaluate if the change from #4 is needed in the patch too?

Post back when the patch is ready, and then if one other person can test the patch against the most recent dev version, we should mark this Reviewed and Tested By the Community (RTBC) and hopefully that will help push this toward getting committed.

tedl’s picture

Tried the pathes on the dev version and it works fine. Would be nice if this could be commited... Thx for the patch by the way!

yesct’s picture

did you use the patch from #2 with or without the suggested change from #3?

tedl’s picture

with #3...

vthirteen’s picture

could not apply the patch

$ patch < location-token.patch
 
(Stripping trailing CRs from patch.)
patching file location.token.inc
Hunk #1 FAILED at 13.
Hunk #2 FAILED at 21.
2 out of 2 hunks FAILED -- saving rejects to file location.token.inc.rej
chx’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.07 KB

I have rerolled this patch... more than a year has passed and this is still a problem.

bdragon’s picture

Status: Reviewed & tested by the community » Fixed

OH, I get it.

Since the location is being saved, it doesn't get the stuff that's applied on loading applied.

http://drupal.org/cvs?commit=316374
http://drupal.org/cvs?commit=316376
http://drupal.org/cvs?commit=316378

province_name and country_name should work properly now.

Status: Fixed » Closed (fixed)
Issue tags: -location compatibility with other modules

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