Shouldn't this be a text field where you could enter a token.

I'm experiencing this problem with a text selection list, a text entry field, and a node reference selection field.

CommentFileSizeAuthor
populate_a_field-no_token.png76.79 KBmitchell

Comments

mitchell’s picture

Title: Cannot use tokens on populate a field action » Impossible to use tokens on 'populate a field' action
Priority: Normal » Critical

Steps to reproduce:
- Create node type "Issue Status" (then add a few)
- Create node type "Issue" with nodereference to "Issue status"
- Create node type "Issue Comment" with nodereferences to "Issue" and "Issue Status"
- Add Rule: when issue-comment is submitted and field status is different than referenced issue, update issue status field
- Event: when new content is submitted
- Condition: content has type "Issue Comment"
- Action: load parent "Issue"
- Condition: (negate) field status on submitted content and field status on parent status
- Action: populate a field on parent issue

You'll find that at this point, there's no way to enter a token. All that is provided is a drop down menu.

fago’s picture

Priority: Critical » Normal
Status: Active » Postponed

Indeed, that's odd. Basically what we would need here is a way for the user to switch between "Value input" and "Value assignment" mode. I've planned to let the user choose that for any action argument in rules 2.

jastraat’s picture

Could someone provide an example for how to get around this problem by using the PHP code option?

johnthomas00’s picture

Possible duplicate of
"Enter Node Reference"
http://drupal.org/node/473338

curtaindog’s picture

return array(
  0 => array('value' => [node:field_revision-formatted] + 1),
);

I have this code attached to an on content being saved event that increments a revision count.

mitchell’s picture

Title: Impossible to use tokens on 'populate a field' action » Add a way for the user to switch between "Value input" and "Value assignment" mode
Version: 6.x-1.x-dev » 7.x-2.x-dev
Component: Provided module integration » Rules Engine
Category: bug » feature
Status: Postponed » Active
fago’s picture

Status: Active » Fixed

That's implemented! :)

Status: Fixed » Closed (fixed)

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