Working with Drupal 7.23, i have configured the patterns for my content types, select the option 'Create a new alias. Delete the old alias', and for example i got this pattern for articles:

articles/[node:field_articles]/[node:original:title]

When i write a new article, and with the 'Generate automatic URL' option checked, at the first submit the path is mysite/content/28, and always need to edit it after, check the box, and now generate the url i want mysite/articles/article-title.

I need definitely to get to work the URL automatic alias at first submit of an article. Any idea?

Comments

trebol’s picture

Please I need help with this. I cannot give a client a site where the path generate did not work well. A patch, a solution, something!!

With this option not working in a site with news and with so many editors working, the whole site go down the drain! I need a solution as quick as possible!!

This is my pattern:

[node:content-type]/[node:field_articulos]/[node:original:title]

wishow’s picture

Title: Generate automatic URL alias only works when edit content. » I have the same problem
Assigned: Unassigned » wishow

I have the same problem...

When create the content, it's created with the default path "node/node_id". I always need to edit de content and "re-check" the 'Generate automatic URL' option box to generate the correct path.

I'm working with the 7.22 version of Drupal core and the latest version of PATHAUTO (7.x-1.2).

Please, somebody knows?

Dave Reid’s picture

Title: I have the same problem » Generate automatic URL alias only works when edit content.
Assigned: wishow » Unassigned
Infoloko’s picture

and another variation! I have a multi-lingual site when I create content the url's are not aliased correctly.

default language is English, 2nd language is Spanish. alias is set up as:

[node:field-xxxxxxx:parents:join-path]/[node:field-xxxxxxx:name]/[myModule:myToken]/[node:title]

this is in both unspecified language and Spanish. in the following all edit does is enter and save, no content changes.

1. On English site, create new content
URL on English site = myDecodedToken/nodeTitle
URL on Spanish site = es/myDecodedToken/nodeTitle
(so only 1 of the 3 node module tokens decodes)

2. On English site, add Spanish translation
URL on English site (has miraculously changed) = node/"nid"
URL on Spanish site = es/nodeJoinPath/nodeName/myDecodedToken/nodeTitle
(so Spanish site is correct)

3. On English site, edit English (original) content
URL on English site = /nodeJoinPath/nodeName/myDecodedToken/nodeTitle
URL on Spanish site = es/nodeJoinPath/nodeName/myDecodedToken/nodeTitle
(so, at last, everything is correct)

in all the above, reversing English & Spanish gives same results (but reversed).

this is a real PITA. Every time we add content we also have to edit it to correct the path!

BUT (there's always a but) if we then update all our URL Aliases (bulk delete and update)
after delete .. both languages ... node/"nid"
after update ..
English = /nodeJoinPath/nodeName/myDecodedToken/nodeTitle
Spanish = es/node/nid

(once again Spanish is incorrect) so do we have to edit ALL the spanish pages to correct the url's? that is, all 2000+ pages?

Infoloko’s picture

I have the same problem as #2 - see #4 - but the "having to re-check the option box" bit .. I had this a while back but adding the "Pathauto persistant state" module (https://drupal.org/project/pathauto_persist) fixed this. (it simply retains the state of the option box on a per page basis)

Infoloko’s picture

Having worked through this - and got a workaround - it appears to me that "field tokens" simply do not work when a node is created. My guess is that the token handler uses "load_node" to ensure up-to-date data and overlooks the simple fact that during a create there is no actual node until the end of the create process.

my workaround is ...

  1. write custom tokens to replace the field tokens then use the custom tokens in URL Alias patterns, and
  2. if like me you also need to generate an alias in a 2nd language then use hook_pathauto_alias_alter to add it (the 'node' is in the context argument)

I've not put my code here as it's specific to my site but I will add it here if anyone wants it

Leeteq’s picture

Issue summary: View changes

Please check if the new 1.3 release fixes this, and if so, close this issue.
If not, it this related to 18n/multilingual (only?). And if so, please change the component of this issue to be "i18n stuff" instead of "miscellaneous".