path_set_alias not working for me :-(

mirek_ - April 13, 2008 - 01:48

hello

i am trying to create a new node creating module and when the node is created, i would like to make automatic alias. so - for example - from original path: node/9 will become task/1. the way, i do this is using the path_set_alias function. not very successfuly. the direct paths are not working for me also. also - when i make direct insert to the database and the query is ok, when i refresh database table - no entry there.

can anybody help? these are my unsuccessful tests:

path_set_alias( "node/9" ); // this should remove existing alias
path_set_alias( "node/9", "task/1" );

>> result - not working :-(

$query = sprintf( "INSERT INTO {url_alias} VALUES (0, '%s', '%s', '')", "node/" . $node->nid, "task/" . $task_id );
$result = db_query( $query );

>> result - is ok (something else than FALSE), but nothing in the url_alias table... :-(

thanks for any comments or hints...

mirek

 
 

Drupal is a registered trademark of Dries Buytaert.