Pathauto does not trigger on node_save when programatically creating nodes I am programatically saving nodes. From my reading, it sounds as if Path auto is trigged to autmatically create a URL alias when node_save() is called.  However, this is not happening.

I later read that I needed to set $node->path_set_alias = TRUE. However, this is not working correctly either.

Using 7.12 and the latest versions of pathauto.

Here is my code.

$node = new stdClass();
        //set other defaults
        node_object_prepare($node);

        $node-&gt;type = $page_data['content_type'];
        $node-&gt;body[LANGUAGE_NONE][0]['value'] = $page_data['description'];
        $node-&gt;body[LANGUAGE_NONE][0]['summary'] = text_summary($page_data['description']);
        $node-&gt;body[LANGUAGE_NONE][0]['format']  = 'filtered_html';
        $node-&gt;title = $page_data['title'];
        $node-&gt;field_product_price[LANGUAGE_NONE][0]['value'] = $page_data['price'];
        $node-&gt;field_item_location[LANGUAGE_NONE][0]['postal_code'] = $page_data['zipcode'];
        $node-&gt;uid = "1";
        $node-&gt;status = 1;
        $node-&gt;active = 1;
        $node-&gt;pathauto_perform_alias = TRUE;

    //the name of my actual field is 'product images'
    $node-&gt;field_product_images[LANGUAGE_NONE] = $images;
    unset($images);




    $node-&gt;field_baby_clothes_category[LANGUAGE_NONE][0]['tid'] = $page_data['category']; 

    if($node = node_submit($node)) { // Prepare node for saving
        node_save($node);
}


Thoughts on how to get this to work correctly? Thanks!
We discussed on Drupal.org that not setting the $node->language property causes this issue to happen. Either setting $node->language = LANGUAGE_NONE or $node->language = 'en' should fix this.

Also using $node->path['pathauto'] = TRUE rather than $node->pathauto_perform_alias for Drupal 7.