Closed (fixed)
Project:
Pathauto
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Nov 2008 at 19:11 UTC
Updated:
27 Dec 2008 at 23:51 UTC
Is there a way to force an alias update via the API?
For example, in my module I add taxonomy terms to a node. But the url() is not immediately returning the path alias. (I suspect there is another bug elsewhere).
So I want to test/bypass the potential bug - and force an alias update on the node.
Comments
Comment #1
nextpulse commentedI tried this:
pathauto_node_operations_update(array($node->nid));
But doesn't seem to work.
Must be another way.
Comment #2
gregglesThat seems like the best way to do it to me, or copying the code in that module...
So, I suggest you debug that a bit more.
Comment #3
nextpulse commentedI am note sure if this a bug. Heres the scenario:
My automated setting for the node is:
mynodetype/[term-raw]/[title-raw]
Now when I do the following to the node:
taxonomy_node_save($node, array($term->tid));
The url('node/nid') gives:
mynodetype/title-of-the-node
It does not see the taxonomy.
Now when edit the content, the taxonomy is there. Only when I do a save on the content page, do I see the url being updated.
I did also try pathauto_node_operations_update(array($node->nid)); after the taxonomy_node_save() - but no effect.
bug? or am I doing something wrong?
Comment #4
gregglesProbably the node has been cached somewhere? By node_load perhaps?
Comment #5
gregglesSince it works properly when edited normally, I'd say that it's a bug in your code.
Maybe look at http://drupal.org/node/178506 which should fire the code in a more "manual like" manner.