rules token of [node_added:nid] returns nothing, its the ONLY token that returns nothing, [node_added:type], [node_added:type-name] or [node_added:title] returns proper strings.

Here is how i get this:

create flag for node with normal link in flag settings to get instant refresh and get drupal_set_message to display after rules is finished

1) add rule with trigger/event "after flagging node..."
2) add action "Add new content" (set it to be Machine readable variable name: node_added)
3) add action "Show a configurable message on the site" (place "NID in question: [node_added:nid]. Other token, just for test: [node_added:type].")

Result "NID in question:. Other token, just for test: bid."

P.S. I also tried to add "save content"

CommentFileSizeAuthor
1247884045077.png69.13 KBhenrijs.seso

Comments

henrijs.seso’s picture

Component: Rules Core » Rules Engine
Status: Active » Closed (fixed)

was working on this for 2 hours, then posted this issue and immediatly after that found a solution of checkbox "Force immediate saving". Maybe this will be useful for someone else :)

Thanks, rules rules!

avpaderno’s picture

Category: bug » support
Status: Closed (fixed) » Fixed

It would be better to set the status to fixed, or other people cannot see this report.
I changed the category as what reported is not a bug of the module.

avpaderno’s picture

Title: rules token of NID returns nothing » node ID token doesn't return anything

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jlyon’s picture

Just to to clarify, if you're creating new content, first you'll need to add an "Add new content" action, then you'll need to add a "Save a content" rule, where you'll need to check "Force immediate saving". Took me a while to figure that out.

m_i_c_h_a_e_l’s picture

for jlyon:

"Force immediate saving" is exactly what I have been searching for, but I need a little help.

I want to create a rule that saves a new node immediately after the add/node form opens.

I have rules module installed, but I can't find "add new content" as an available or advanced action.

I'm sure it's something very simple. What am I missing?

Thanks

Mike