Comments

I'm unable to duplicate this with just core + Token + Pathauto. Changing the menu link title and then saving the node does in fact properly update the URL alias with the changed menu link title right away.

I have just tested this issue again following the steps above, using a new standard installation of Drupal 7.10, Token 7.x-1.0-beta7, and Pathauto 7.x-1.0.
All modules and configurations are left as default except pathauto pattern for nodes as described above.
And the result is exactly the same.

So far, I have tested this on 2 live sites, a D7.9 devel site with all modules disabled, and a fresh installation of D7.10 with the sole purpose of testing this. All these sites are showing this behaviour. I am convinced that it's not just me so I am changing status back to active.

I still have no idea how menu_node_update() could run before pathauto_node_update(). Both modules *should* have a weight of 0 which means they should get run in alphabetical order and m comes before p. Can you check your {system} table to confirm that the weight column for both modules is zero?

I am experiencing this problem as well. It definitely looks like the pathauto update function runs before the menu function. The alias doesn't change on the initial save with menu update, but if I edit the page again and select "Generate automatic URL alias" it will generate correct. I have tested this with Core 7.12, Token 1.0 and Pathauto 1.0.

I was finally able to track down the cause of this bug on our site. We are new doing a ton of custom functionality which really changes how our paths work, however I think the bug still comes back to the same thing.

When the token module looks up the menu link item for a certain token, it caches that result. There is a pathauto_create_alias() call in pathauto_field_attach_form() that will fire this menu lookup early in the node save execution and prior to the menu item update. Thus this result is cached with the old menu item and not the new one. When the expected pathauto_create_alias() is fired in the pathauto_node_update() function, it pulls the cached results with the old menu item.

To resolve the problem we were able to manually clear the cache for that function in a hook_node_update(), in our case right before we create the pathauto alias.

I can confirm this is happening in the 7.1.1 version too.
I am working on a similar issue with the [node:menu-link:parent:url:path] token - same symptoms, moving sub page from page 1 to page 2 drops the alias and won't apply until I recheck the "generate automatic..."

Adding the "drupal_static_reset('token_menu_link_load');" line to a simple module in hook_node_update() also fixes this issue