“Undefined index: path” on wp_insert_post

Solution:

wp_insert_post() should be used like this:

$post_data = array(
    'post_status'           => 'draft', 
    'post_type'             => 'post',
    'post_author'           => $user_ID,
    'ping_status'           => get_option('default_ping_status'), 
    'post_parent'           => 0,
    'menu_order'            => 0,
    'to_ping'               => '',
    'pinged'                => '',
    'post_password'         => '',
    'guid'                  => '',
    'post_content_filtered' => '',
    'post_excerpt'          => '',
    'import_id'             => 0
);

$post_id = wp_insert_post( $post_data );

For a full list of what you can include in the $post_data array see: http://codex.wordpress.org/Function_Reference/wp_insert_post