I am trying to get the Alias from a given system path node NID (node/nid), inside of a node_insert function in a custom module.
I already tryied:
drupal_get_path_alias('node/866'); // return node/866 in watchdog dblog
and
url('node/866'); // return node/866 in watchdog dblog
and
drupal_lookup_path('alias', 'node/866'); // return NOTHING in watchdog dblog
and
drupal_get_normal_path('node/866'); // return node/866 in watchdog dblog
It should return seo/preparedUrl
, but I can´t find a way to do this.
I need this to change a path before the node is saved.
In URL alias (admin/config/search/path) the Alias(seo/preparedUrl) and System (node/866) are there!
THE ANSWER
First of all, Thanks to @arpitr with the help with devel/php path sugestion! Really fast debug this way!
The answer in my case is that is two languages. The path was in language, but my user was in another so, when I use dpm it continues to print the node/nid, but when I changed my user language to be equals to content language it began to work the way I want!
(I can´t answer my own question or vote up nothing here because I am a new user, so I putted here!)