When pathauto uses a category variable in the path and when the first time a node is created it uses the first category in the list of categories (when free-text entry of categories is permitted) irrespective of alphabetical order. It only depends on the order in which categories are entered. however when the node is edited next time and the categories are not changed pathauto then uses the first category alphabetically. This is because by default the categories have already been sorted by the system.
One option would have been to allow setting the category which needs to be set as the value that gets used by the category variable for pathauto.

Comments

greggles’s picture

I believe this problem is solved in the 5.x-2.0 version of Pathauto. I don't plan to work on this bug but if someone else were to create a patch for it I might consider applying it given that they got a good amount of testing.

anoopjohn’s picture

Ok I will upgrade and report if there are any problems.
Cheers
Anoop

greggles’s picture

Great - be sure to read the release notes / upgrade docs. You will need to reconfigure your site (including installing token before pathauto).

greggles’s picture

Status: Active » Closed (won't fix)

Assumed to be fixed with 2.0 (and therefore a won't fix for 1.x). Please re-open if that is not the case.

anoopjohn’s picture

The issue is fixed in version 2. I upgraded to the new version and is working fine. Besides I took out the category from the URL as i think it makes more sense to have the URL without the category when the categories are not exclusive.
Cheers
Anoop

greggles’s picture

That is great to hear that it is fixed in 2.x. I think there are valuable cases to have the term in the url, but if you feel it isn't appropriate for your situation then I can't argue with that ;)

anoopjohn’s picture

The issue is that if there are multiple categories which apply to a post, which category do you assign it to? Yes it can be accessed from multiple categories even if you assign it to one category, but what about the URL? I guess it the SEO that you are talking about, isn't it?
Cheers
Anoop

greggles’s picture

Well, Pathauto does it based on the lowest weight term. In general the lowest weight term should be the most important term to the site. On the other hand, with freetagging you probably don't set weights for the terms. The other argument is that having any keyword in the url is better than having none (seo and usability reasons).