Closed (outdated)
Project:
Rules
Version:
6.x-1.x-dev
Component:
Rules Core
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2011 at 14:41 UTC
Updated:
14 Apr 2018 at 01:17 UTC
Jump to comment: Most recent
Comments
Comment #1
itangalo commentedDoes your rule run at the node save moment, or after the node has been saved?
If it is during the save moment, new nodes probably won't have any URL alias associated with them yet.
Could this be the case?
//Johan Falk
I'm a part of the Rules Issue Squad, helping out in the issue queue. You can join, too!
Comment #2
hedac commentedthank you for your answer.
Yes. It is "ON event After saving new content"
Comment #3
itangalo commentedHah! I read and re-read the issue above. And then I realized that "[node:node-path]" really suggests that it is returning the path for the node – not the URL alias.
Does the replacement descriptions really say that it should return the alias for the node, or is this a case of not-so-clear help text?
Comment #4
hedac commentedin the Token replacement patterns in the rule action I see "[node:node-path] The URL alias of the node." so yes it says it should return the URL Alias.
there is another token which is [node:node-url] but this is not the alias.
so I create a node and pathauto assigns the node automatically an alias, but in the rules action it doesn't seem to get that alias.. instead it returns the node/xxxx path... where xxx is the number of the node...
but thinking it twice.. maybe this is an issue of token module and not rules.
Comment #5
itangalo commentedHm, yeah, it is most likely a Token thing and not Rules.
You could try using the other token (node:node-url), and see if there has just been some intermixing. It would still be a bug to report, though.
Thanks for your patience.
I would have changed the project for this isssue to Token, but I don't know which version you're using…
Comment #6
mhindman commentedI was having this same issue and found a workaround. Thought I would share for anyone else encountering the same issue.
Tada. Basically, I think what Itangalo pointed out in comment #1 is pretty much what's happening. Making it load the node first ensures the alias is created before executing the rest of the actions.
Comment #7
dave reidAs far as the token goes, if [node:node-path] isn't returning the alias, then it simply means the alias hasn't been saved yet. We can't do more than try to return the result of drupal_get_path_alias('node/[nid]') which will return the same thing if there is no alias.
Comment #8
tr commented