Different behaviour saving programatically vs UI I am having a problem saving nodes programatically.  I am attempting to save nodes that use the following pathauto pattern for an alias:

[node:og-group-ref:0:url:relative]/[node:menu-link:parents:join-path]/[node:title]

Both the first and last token work fine both ways.  However, the middle token - [node:menu-link:parents:join-path] - returns empty when saving through a script and populates fine when saving through the UI.

I've inspected $node object that is being passed through in each case and they are identical, except for $node->path.  When saving through the UI the $node->path value looks something like this (copied from devel dsm message):

[path] =&gt; Array
    (
      [alias] =&gt; communications/some-person
      [pid] =&gt; 153
      [source] =&gt; node/100
      [language] =&gt; und
      [pathauto] =&gt; 1
    )


However, when saving programatically $node->path looks like this: 

[path] =&gt; Array
          (
            [pathauto] =&gt; 1
            [alias] =&gt; 
          )


As you can see, its missing data that is present when saving through the UI, and I suspect that data is needed to correctly parse the token.

Anyone have any idea why these two would be different or why the [node:menu-link:parents:join-path] token doesn't work when saving through the script?

If it matters, script is pretty straight-forward:

&lt;?php
$nids = db_query('SELECT nid FROM {node} where nid = 100')-&gt;fetchCol();
foreach (node_load_multiple($nids) as $node) {
  echo "Saving node " . $node-&gt;nid . "\r\n";
  print_r($node);
  node_save($node);
}


Thanks in advance.
For anyone that might find this in the future, this is related to this issue:

http://drupal.org/node/1534356

Still trying to figure out a workaround for my scenario, but this is the cause.