In hook_node_insert() i have used drupal_goto(), to go to the newly created node with alias name of it, but id doesn't work.
I have already created url alias with patterns for that content type.
$alias = drupal_get_path_alias($node->nid);
drupal_goto($alias);
If i give drupal_goto() with nid it works.
drupal_goto('node/'.$node->nid);
What is the issue with respect to alias name not working or how to get alias of newly created node and get it redirected to view page of it with alias name as url.
Any ideas or suggestions? Thanks in advance.